perm filename PASMAN.ARR[UP,DOC] blob sn#608242 filedate 1981-08-14 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00070 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00007 00002	   
C00008 00003
C00010 00004			CONTENTS.				- 1-
C00014 00005			CONTENTS.				- 2-
C00017 00006	_	_	FOREWORD.				- 3-
C00021 00007			PREFACE TO THE HAMBURG REPORT.		- 4-
C00024 00008			1. USAGE.				- 5-
C00027 00009			1.1. MONITOR COMMANDS.			- 6-
C00031 00010	_	_	1.2. DIRECT USAGE.			- 7-
C00034 00011			1.3. RUNNING YOUR PROGRAM.		- 8-
C00037 00012			1.4. LEXICAL ISSUES.			- 9-
C00041 00013			1.4. LEXICAL ISSUES.			-10-
C00045 00014	_	_	1.5. COMPILER DIRECTIVES (SWITCHES).	-11-
C00048 00015			1.5. COMPILER DIRECTIVES (SWITCHES).	-12-
C00051 00016			1.5. COMPILER DIRECTIVES (SWITCHES).	-13-
C00053 00017			2. THE PROGRAM HEADING.			-14-
C00057 00018	_	_	2.1. PROGRAM PARAMETERS.		-15-
C00060 00019			2.2. TEMPCORE-FILES.			-16-
C00064 00020			3. LABELS.				-17-
C00069 00021			3. LABELS.				-18-
C00071 00022	_	_	4. INPUT AND OUTPUT.			-19-
C00075 00023			4.1. STANDARD FILES.			-20-
C00079 00024			4.2. FORMATTED INPUT/OUTPUT.		-21-
C00082 00025			4.2. FORMATTED INPUT/OUTPUT.		-22-
C00086 00026	_	_	4.3. PRINTER CONTROL CHARACTERS.	-23-
C00089 00027			5. EXTENSIONS TO STANDARD PASCAL.	-24-
C00092 00028			5.3. STANDARD FILES.			-25-
C00097 00029			5.4. THE INITPROCEDURE.			-26-
C00100 00030	_	_	PACK, UNPACK,DATE, TIME, CLOCK, REALTIME -27-
C00103 00031			FIRST, LAST, LOWERBOUND, UPPERBOUND	-28-
C00106 00032			MIN, MAX, NEW, DISPOSE			-29-
C00110 00033			TRUNC, ROUND AND EXPO			-30-
C00112 00034	_	_	OPTION, GETOPTION			-31-
C00115 00035			HALT, CALL				-32-
C00118 00036				CALL...				-33-
C00120 00037				CALL...				-34-
C00122 00038	_	_	GETFILENAME, GETSTATUS			-35-
C00125 00039			RESET, REWRITE				-36-
C00129 00040			BREAK, MESSAGE, GETLN, GETLINENR	-37-
C00133 00041			PUTLN, PAGE, EOLN, EOF			-38-
C00136 00042	_	_	ASKFILENAME, STARTFILE			-39-
C00141 00043			SETTIME, TIMEREPORT, RUNTIME, ELAPSEDTIME -40-
C00144 00044			5.7.19. THE STRING PACKAGE.		-41-
C00147 00045			5.7.19. THE STRING PACKAGE.		-42-
C00150 00046	_	_	5.7.19. THE STRING PACKAGE.		-43-
C00153 00047			5.7.19. THE STRING PACKAGE.		-44-
C00155 00048			5.8. PROCEDURES AND FUNCTIONS AS PARAMETERS. -45-
C00158 00049			5.8. PROCEDURES AND FUNCTIONS AS PARAMETERS. -46-
C00161 00050	_	_	6. EXTERNAL PROGRAMS.			-47-
C00164 00051			6.2. HOW TO COMPILE EXTERNAL PROGRAMS.	-48-
C00167 00052			6.3. HOW TO CREATE A PROGRAM LIBRARY.	-49-
C00169 00053			7. THE PASCAL DEBUG-SYSTEM.		-50-
C00173 00054	_	_	7.1. COMMANDS.				-51-
C00176 00055			7.2. PROGRAM INTERRUPTS.		-52-
C00179 00056			8. TABLES.				-53-
C00182 00057			8.1. OPERATIONS.			-54-
C00184 00058	_	_	8.3. STANDARD PROCEDURES AND FUNCTIONS.	-55-
C00187 00059			8.3. STANDARD PROCEDURES AND FUNCTIONS. -56-	
C00189 00060			8.4. RUN-TIME ERROR MESSAGES.		-57-
C00192 00061			8.5. ASCII TABLE.			-58-
C00194 00062	_	_	9. MISCELLANEOUS.			-59-
C00198 00063			9.3. UTILITY PROGRAMS: PCREF.		-60-
C00202 00064			9.3.1. SWITCHES.			-61-
C00207 00065			9.3.2. READING THE OUTPUT.		-62-
C00211 00066	_	_	9.3.2. READING THE OUTPUT.		-63-
C00213 00067			9.4. UTILITY PROGRAMS: PFORM.		-64-
C00216 00068			9.4.1. SWITCHES.			-65-
C00219 00069			10. REFERENCES.				-66-
C00222 00070	_	_	10. REFERENCES.				-67-
C00223 ENDMK
C⊗;
   
 
 
 
 
 
 
	
	
	
	
	
	
	
	
	
	
	
	
	

	
			   PASCAL and PASSGO at LOTS
	
	
				      by
	
			     ARMANDO R. RODRIGUEZ.
	
	



 
				SECOND EDITION

				SEPTEMBER 1979
















					Adapted from

					Pascal for the DECSystem-20
					By E. Kisicki and H. H. Nagel.









      (C) COPYRIGHT 1978, 1979
              BOARD OF TRUSTEES
              LELAND STANFORD JUNIOR UNIVERSITY
              STANFORD, CA. 94305, U. S. A.

      (C) COPYRIGHT 1978, 1979
              ARMANDO R. RODRIGUEZ
              LOTS COMPUTER FACILITY
              STANFORD UNIVERSITY
              STANFORD, CA. 94305, U. S. A.

      (C) COPYRIGHT 1976,
              H. H. NAGEL
              INSTITUT FUER INFORMATIK
              DER UNIVERSITAET HAMBURG
              SCHLUETERSTRASSE 70
              2000 HAMBURG-13
              GERMANY


	Pascal and Passgo at Lots
	  By Armando R. Rodriguez.

	Adapted from

	Pascal for the DECSystem-20
	  By E. Kisicki and H. H. Nagel.

	First Edition	September 1978

	Second Edition  September 1979.
		CONTENTS.				- 1-
 
 
	Contents							Page.
	========
	
	 1.   Usage of the PASCAL and PASSGO compilers			 5
	      1.0.   Rules on File Names				 5
	      1.1.   How to Use the Monitor Commands to Compile
			your Program					 5
		     1.1.1.    PASCAL					 5
		     1.1.2.    PASSGO					 6
	      1.2.   How to Use the PASCAL and PASSGO  Compilers
			Directly					 6
		     1.2.1.    PASCAL					 6
		     1.2.2.    PASSGO					 7
	      1.3.   How to Run a PASCAL/PASSGO Program			 8
		     1.3.1.    PASCAL					 8
		     1.3.2.    PASSGO					 8
	      1.4.   Lexical Issues					 9
	      1.5.   Compiler Directives (Switches)			10
		     1.5.1.    Summary					10
		     1.5.2.    Selective Use of Compiler-Options	13
	 2.   The Program Heading					14
	      2.1.   Substitution of the Program Parameters		14
	      2.2.   Passing Parameters with TEMPCORE-files		16
	 3.   Labels							17
	 4.   Input and Output						19
	      4.1.   Standard Files					19
	      4.2.   Formatted Input/Output				20
		     4.2.1.    Formatted Input				20
		     4.2.2.    Formatted Output				21
	      4.3.   The Use of Printer Control Characters		23
	5.    Extension to STANDARD PASCAL				24
	      5.1.   Standard Constants					24
	      5.2.   Standard Types					24
	      5.3.   Standard Files					25
	      5.4.   The INITPROCEDURE					25
	      5.5.   The Extended CASE Statement			26
	      5.6.   The LOOP Statement					26
	      5.7.   Standard Procedures and Functions			27
		     5.7.1.    PACK and UNPACK				27
		     5.7.2.    DATE and TIME				27
		     5.7.3.    CLOCK and REALTIME			27
	       	     5.7.4.    FIRST and LAST				28
		     5.7.5.    LOWERBOUND and UPPERBOUND		28
		     5.7.6.    MIN and MAX				29
		     5.7.7.    NEW and DISPOSE				29
		     5.7.8.    TRUNC, ROUND and EXPO			30
		     5.7.9.    OPTION and GETOPTION			31
		     5.7.10.   HALT and CALL				32
		     5.7.11.   GETFILENAME and GETSTATUS		35
		     5.7.12.   RESET and REWRITE			36
		     5.7.13.   BREAK and MESSAGE			37
		     5.7.14.   GETLN and GETLINENR			37
		     5.7.15.   PUTLN and PAGE				38
		     5.7.16.   EOLN and EOF				38
		     5.7.17.   ASKFILENAME and STARTFILE		39
		     5.7.18.   SETTIME, TIMEREPORT, RUNTIME and
				ELAPSEDTIME				40
		CONTENTS.				- 2-
 
 
		     5.7.19.  The String Package.			41
			      5.7.19.1.  Predeclared Types and
					    Constants			41
			      5.7.19.2. Assign, Length and Pos		42
			      5.7.19.3.  Substr and Concat		42
			      5.7.19.4.  Getchar and Putchar		43
			      5.7.19.5.  String Comparison: Strlt,
					    Strle, Streq, Strge, 
					    Strgt, Strne		43
			      5.7.19.6.  Strings in Read and Write	44
	      5.8.   Procedures and Functions as Parameters		45
	 6.   External Programs						47
	      6.1.   Declaration of External Procedures and Functions	47
	      6.2.   How to Compile External Programs			47
	      6.3.   How to Create a Program Library			48
	 7.   The PASCAL DEBUG-system					50
	      7.1.   Commands						50
	      7.2.   Program Interrupts					52
	      7.3.   How to Debug External Programs			52
	 8.   Tables							53
	      8.1.   Operations						53
		     8.1.1.   Summary					53
		     8.1.2.   Precedence				54
	      8.2.   Reserved Words					54
	      8.3.   Standard Procedures and Functions			55
		     8.3.1.   Procedures				55
		     8.3.2.   Functions					55
	      8.4.   Run-time Error Messages				57
	      8.5.   ASCII Table					57
	 9.   Miscellaneous						59
	      9.1.   Implementation Restrictions			59
	      9.2.   Known Bugs						59
	      9.3.   Utility Programs: PCREF 				60
		     9.3.1.   Switches					61
		     9.3.2.   Reading the Output			62
	      9.4.   Utility Programs: PFORM 				64
		     9.4.1.   Switches					65
	10.   References						66
_	_	FOREWORD.				- 3-


	Foreword
	========

	  The PASCAL and PASSGO compilers were developed at the LOTS computer
	facilty, at Stanford University, USA, based on the Hamburg PASCAL
	compiler for the DECSystem-20. The aim was to provide a faster and
	more efficient PASCAL compiler, fix some small bugs, provide a nicer
	and smoother interface, and mainly, to develop a Load-and-Go compiler
	(PASSGO) that could support all the features of this particular 
	implementation of PASCAL, making it possible to switch back and forth
	between the two compilers. An effort was made also to improve the
	documentation in the source listing of the compiler itself, and to
	reduce duplicated code, to simplify maintenance in the future. The
	resulting compilers are both compatible with DECSystem-10 computers,
	but all the documentation was rewritten to reflect the system at
	LOTS, a DECSystem-20 computer under the TOPS-20 EXEC Monitor.

	  This report is intended to familiarize the reader with both PASCAL
	and PASSGO at LOTS. They will both accept standard PASCAL as a subset.
	They both support everything described in this report, except for one
	thing: PASSGO does not allow the use of External Procedures.
	Throughout this report, the mention of PASCAL refers to both PASCAL
	and PASSGO, except when explicitly specified otherwise.

	  The report evolved from the report developed by E. Kisicki and H.H.
	Nagel for their PASCAL for the DECSystem-10, distributed by DECUS.
	An attempt was made to keep it as close as possible to its original
	form. I gratefully acknowledge the help of J.Q. Johnson, Ralph Gorin,
	John Hennessy, Mike Byron, Queenette Baur, and the volunteers at LOTS,
	whose advice and suggestions facilitated the task of producing both
	this report and the PASCAL/PASSGO compiler itself.

	  Work on improvements to the compilers continues at LOTS, and the 
	manual will change as new features are added or old bugs disappear.
	an effort will be made to retain the page numbering along updates
	of the same edition.


	   Please direct all your comments, suggestions, complaints, etc.,
	on this report and on PASCAL and PASSGO, to A.ARMANDO or to
	J.JQJOHNSON, at LOTS, or to CSL.ARMANDO at SCORE, ARR at SAIL,
	or to
		Armando R. Rodriguez
		Computer Science Department
		Stanford University
		Stanford, Ca 94305




					Stanford, California, USA
					September, 1978.
		PREFACE TO THE HAMBURG REPORT.		- 4-
 
 
	Preface	to the Hamburg Report
	=============================
	
	   The PASCAL compilers for the DECSystem-10 were  developed  at  the
	 University  of  Hamburg,  Germany,  based on an early version of the
	 transportable PASCAL-P compiler [4,5,6].  Work  still	continues  on
	 improving  this compiler with respect to efficiency, standardization
	 and the addition of still missing  or	desirable  language  features
	 [7].
	
	   This  report is intended to familiarize the reader with the PASCAL
	 dialect on  the  DECSystem-10.      This  description	refers	to  a
	 DECSystem-10 compiler with the name PASCAL that will accept STANDARD
	 PASCAL (and some features of PASCAL 6000-3.4) as defined by Wirth in
	 [2] as a subset.
	
	   It should be noted  that  earlier  compiler	versions  or  special
	 purpose  Load-and-Go PASCAL compilers might accept a modified PASCAL
	 language not compatible with STANDARD PASCAL and its  extensions  as
	 accepted by this compiler.
	
	   It is assumed that the reader has a basic knowledge about PASCAL.
	
	   Within syntax definitions, terms enclosed in "[]" are optional and
	 terms enclosed in "[]*" may appear zero or more times. The word "or"
	 or a vertical bar "|" indicate alternative terms.
	
	   This  report evolved from a PASCAL HELP file originally written in
	 German which has been translated into English by Burger [11].	 This
	 version  has  been  completely reworked from the english version. We
	 gratefully acknowledge the help of B.Gisch and  H.Linde  in  editing
	 this report.
		1. USAGE.				- 5-


	1. Usage of the PASCAL and PASSGO compilers
	============================================


	1.0. Rules on File Names
	------------------------

	   All the PASCAL programs, including the PASCAL and PASSGO compilers
	 have the following  restrictions  on file description: The file name
	 should not  have  more  than 6 characters, and the file extension is
	 restricted to a maximum of 3 characters. The standard extension for a
	 program file to be compiled by PASCAL is PAS, and for one to be run
	 under PASSGO is PGO.

	Example:

		MYPROG.PAS	and
		THIS.PGO		are valid program names.

		TOOLONG.PAS		is not.



	1.1. How to Use the Monitor Commands to Compile your Program
	------------------------------------------------------------


	1.1.1.	PASCAL
	--------------

	   There are four monitor (EXEC) commands that will invoke the 
	 compiler. They are known as the "COMPIL-Class Commands". They are:

		COMPILE		will only compile your program, producing a 
				relocatable (.REL) file.
		LOAD		will compile (if needed) and load the .REL
				file into absolute code in memory, but it
				will not start the execution of your program.
		EXECUTE		will compile (if needed), load into memory 
				and start execution of your program.
		DEBUG		will do the same as EXECUTE, except that it
				will load together with your program the
				PASCAL debugger, DEBUG. (refer to 7.)

	   These commands can be used in conjunction with the START and SAVE
	 commands, to obtain different effects.

	Example:

	   The following two sequences will both compile, load and execute
	 your program, from a source file called MYPROG.PAS

		@EXECUTE MYPROG		and

		@COMPILE MYPROG
		@LOAD MYPROG
		@START
		1.1. MONITOR COMMANDS.			- 6-


	   Depending on the command the program  is  compiled  and/or  loaded
	 and/or  executed.	The program is compiled if the PAS-file has a
	 younger creation  date  than  the  REL-file  -if  existent-.	  The
	 compilation can be forced using the COMPILE-option (refer to 1.5.).

	   You can add the switch /LIST or /CREF to obtain, respectively,
	 a listing of your program (and error messages, if any) on the line
	 printer, or a cross-referenced, reformated listing in a file called
	 MYPROG.CRL, and a reformatted source in the file MYPROG.NEW. If both
	 switches are used, /LIST is ignored.



	1.1.2. PASSGO
	-------------

	   You can use the same commands, but since this is a Load-and-Go
	 compiler, they will have different effects:

		COMPILE and LOAD will only check your program for errors. No
		  object code is generated. If you expect any errors, use of
		  these commands instead of EXECUTE will make the compilation
		  faster.
		EXECUTE and DEBUG work the same as with PASCAL. The switches
		  work also the same.

	   You can also use the switches /PASCAL and /PASSGO to force the
	 Monitor to call one compiler or the other, even if the extension in
	 your source file is not the appropriate.

	Example:

		@EXECUTE MYPROG.PAS/PASSGO/LIST

	 will call the PASSGO compiler, and produce a line printer listing.

 
 
	1.2. How to Use the PASCAL and PASSGO  Compilers Directly
	---------------------------------------------------------
	

	1.2.1. PASCAL
	-------------

	   The compiler is executed by
	
		@PASCAL
	
	 In  this  case  the compiler will prompt the user at his terminal to
	 provide file descriptions and compiler-options for source, list  and
	 relocatable object code files (refer to Section 2.1. or 5.7.9.   for
	 more detailed information).  The file description has the  following
	 form:
	
		DEVICE: FILNAM.PAS [PROJECT, PROGRAMMER]
		------- 	   ---------------------
_	_	1.2. DIRECT USAGE.			- 7-

	
	 The underlined parts may be omitted. They are by default
	
		DEVICE			DSK
		[PROJECT, PROGRAMMER]	own PPN
	
	 The compiler-options may be appended to any of the  following  file
	 descriptions. Refer to section 1.5. for details on compiler-options.
	
	Example:
	
		@pascal
		OBJECT = filnam.rel/codesize:800	relocatable object
		LIST = filnam.lst/code			listing
		SOURCE = filnam.pas/nocheck/debug	source file
	
	   If e.g. the file description for OBJECT is defaulted, the compiler
	 generates  relocatable object code on a file named FILNAM.REL, where
	 FILNAM is the name of your source file. SOURCE is defaulted to 
	 the name SOURCE. (refer to 2.1 and 4.1). A listing is generated if
	 either the LIST-, or CODE-option is specified or if a file
	 description for LIST is provided. If defaulted, it will be called
	 FILNAM.LST. You can omit the extension in all three file descrip-
	 tions. They will be defaulted to .REL, .LST and .PAS, respectively.
	 (In the case of SOURCE, if no file is found with the extension .PAS,
	 and the extension was defaulted, the file name with no extension 
	 will be tried.).
 
 
 
	1.2.2. PASSGO
	-------------

	   The compiler is executed by

		@PASSGO

	 The file description is the same as in PASCAL, but PASSGO will not 
	 ask for the OBJECT file, and some compiler-options, like CODE, will
	 not work: It will issue a warning message and ignore them.
	 The default extensions are .LST and .PGO
 
	Example:

		@passgo
		LIST =
		SOURCE = myprog/debug

	  will execute MYPROG.PGO, invoking DEBUG.
		1.3. RUNNING YOUR PROGRAM.		- 8-
 

	1.3. How to Run a PASCAL/PASSGO Program
	---------------------------------------
	

	1.3.1. PASCAL
	-------------

	   Compilation starts when the following message is output:
	
		PASCAL/LOTS: FILNAM [<program name>: <entry>, ...] PAGE 1..
	
	 After successful  compilation	the  following	size  information  is
	 output:
	
		HIGHSEG: u K + m WORD(S)
		LOWSEG : v K + n WORD(S)
	
	 The first line denotes the core  requirement  for  the  high-segment
	 (code)  in  K,  the  next  line denotes the core requirement for the
	 low-segment (data) in K.
	   If the compiler has generated relocatable code on FILNAM.REL,  the
	 program is loaded by
	
		@LOAD FILNAM.REL or @LOAD FILNAM

	   After that, an executable (.EXE) file is obtained by
	
		@SAVE FILNAM
	
	   At this point, the program can be executed by

		@START

	   Later on, the executable file is executed by
	
		@FILNAM
	


	1.3.2. PASSGO
	-------------

	   There is no need to LOAD, and no way to SAVE a program compiled
	 by PASSGO, since there is no .REL file. It will not give you the
	 core size information. A sample run is:

		@passgo
		LIST =
		SOURCE = myprog

		PASSGO/LOTS: MYPROG [ RUNNER     ] 1..
		   0 ERROR(S) DETECTED

		   COMPILE RUNTIME: 00:01.572	  ELAPSED: 00:00:04.3	1000 CHARS

		MYPROG : EXECUTION
		MYPROG     RUNTIME: 00:03.142	  ELAPSED: 00:00:07.2
		1.4. LEXICAL ISSUES.			- 9-
 
 
	1.4. Lexical Issues
	-------------------
	
	   The PASCAL/PASSGO compilers  accept only a subset of the ASCII
	 characters, namely the 64 characters with octal values from 40 to
	 137. Characters with octal codes between 140 and 177 (essentially
	 the "lower case" characters)  are  converted  to "upper   case"   by
	 subtracting  40  octal from their code.   The TABulator-character is
	 expanded on input from  text-files  to  the  appropriate  number  of
	 blanks.  Lines  are  ended  by  a  Line-Feed.	 All other characters
	 appearing in the input text are ignored (refer to 4.).
	
	   Next  we  shall  describe  language	elements  which  use  special
	 characters.
	
	   Comments are enclosed in (* and *), e.g.:
	
		(*THIS IS A COMMENT*)
	
	   Identifiers	must  differ over their first 10 characters. They may
	 be written using the underline-character (which is sometimes printed
	 as left-arrow) to improve readability, e.g.:
	
		NEW_NAME
	
	   String-constants   are    character	  sequences    enclosed    in
	 single-quotes, e.g.:
	
		'THIS IS A STRING'
	
	 If a quote is to appear in the string it must be repeated, e.g.:
	
		'ISN''T PASCAL FUN?'
	
	 (PACKED)  arrays  of  CHAR  or  subranges of CHAR are referred to as
	 strings throughout this report.
	
	   An INTEGER-constant is represented in octal form if it consists of
	 octal digits followed by B. An INTEGER is represented in hexadecimal
	 form if  it  consists	of  a  "  (i.e.   double-quote)  followed  by
	 hexadecimal  digits.	The  following	representations have the same
	 value:
	
		63     77B     "3F
	
	   A REAL-constant is defined as
	
		<real>	 ::= [<sign>]<number>[.<number>][E[<sign>]<number>]
		<number> ::= <digit> [<digit>]*
	
	   SET-constants are element lists enclosed in "[]", e.g.:
	
		['A', '+'] or [1, 15]
	
	 Subrange notation is allowed inside of SET-constants, e.g.:
	
		['A'..'Z', '0'..'9'] or [1..7, 12..17]
		1.4. LEXICAL ISSUES.			-10-

 
	 SETs  within  a  program may contain variables - compatible with the
	 type of the SET elements - , e.g.:
	
		 ...
		VAR S: SET OF CHAR;
		    C: CHAR;
		 ...
		S := ['A'..'C', C, '+','-'];
		 ...
 
 
 
	1.5. Compiler Directives (Switches)
	-----------------------------------
	
	   Compiler-options  are  written  as comments	and are designated as
	 such by a '$'-character as the first character of the comment, e.g.:
	
		(*$T-,E+,D+,R15   the rest is comment	*)
	
	 An option is turned on if it is followed by '+' and it is turned off
	 if  it  is  followed  by  '-'.   Some options must be followed by an
	 INTEGER.   Options may alternatively  be  specified  at  translation
	 time,	either	with  the  COMPILE-, LOAD-, or EXECUTE-command	or by
	 appending the options to the file names  if the compiler is executed
	 directly  (refer  to  1.1-2.).       Any  compiler-option explicitly
	 requested in the source-program overrides  compiler-options provided
	 at translation time.
 
 
 
	1.5.1. Summary
	--------------
	
	   There  are certain compiler-options which can only be specified at
	 translation time. For these, no source-program switch is indicated.
	
	   Other compiler-options -marked with (*)- have to be specified  for
	 the  first time BEFORE the program heading.	Some of these -marked
	 with (**)- cannot be reset anymore inside the program.
	
	   In  the  following table the inverse option -if possible- is given
	 below the positive  option.  The  options  are  divided  into	three
	 groups:
	
		(1)  Compiler-options
		(2)  "COMPIL-class" Command-options
		(3)  Loader Command-options

	(*NOTE: in DEC10 sites, you can give the translation time switches that
	are not known by the compile-class commands, by surrounding them with
	parentheses. In DEC20 sites, this feature is not supported by the system,
	so you have to call the compiler directly.*)

_	_	1.5. COMPILER DIRECTIVES (SWITCHES).	-11-
 
 
	Function			Specification		Default
	I				in source program	I
	I				I	at compilation	I
	I				I	I  time		I
	----------Compiler-options---(PASCAL and PASSGO)---------------------
	Make a hardcopy of the error	G+	   LOG
	messages, in file SOURCE.LOG	G-	 NOLOG		off

	Perform runtime tests.		T+	  CHECK		on
	 1) array indices		T-	NOCHECK
	 2) assignments to subranges
	 3) zero-divide
	 4) arithmetic overflow
	 5) variables in
	    SET-constants
	 6) input to file variables
	    or variables of subrange
	    types
	 7) Nil and uninitialized pointers
	
	Enable debugging including	D+	  DEBUG		off
	Post-Mortem dump. (*)		D-	NODEBUG
	P is accepted in addition to	P+
	D to maintain compatibility	P-
	with PASCAL 6000.
	
	Maximum number of instructions	Sn 	  CODESIZE:n	n=1000
	that may be generated for the
	statement part of a "main
	progam", procedure or
	function. (**)
	
	Highest register used to 	Xn	  REGISTER:n	n=6
	pass parameters, with n in
	[2..12]. External procedures
	must be compiled with the
	same value that is assumed
	in the main program. (**)

	Generate listing (default: in		  LIST		on
	file .LST)				NOLIST
	
	Generate cross-reference list.		  CREF		off
						NOCREF
	
	Generate cross-reference list  C+  	  PROFILE	off
	with counts of execution for   C-	NOPROFILE
	each basic block (no-branch code)

	----------Compiler-options---(Not allowed in PASSGO)-----------------
	List object code as MACRO-10.	L+	  CODE		off
					L-	NOCODE		
	
	All level-1 procedures or	E+	  EXTERN	off
	functions of a program may be	E-	NOEXTERN
	activated by other programs.
	Refer to 6. for detailed information. (**)
		1.5. COMPILER DIRECTIVES (SWITCHES).	-12-
 
 
	Function			Specification		Default
	I				in source program	I
	I				I	at compilation	I
	I				I	I  time		I
	---------------------------------------------------------------------
	Only the first 72 characters	U+	  CARD		off
	of a source program line are	U-	NOCARD
	accepted for compilation
	(card format). (**)
	
	Size of low-segment in K	Rn	  RUNCORE:n	n=240
	words. (**)

	Enable FORTRAN-I/O in external	I+	  FORTIO   	off
	FORTRAN subroutines. (**)	I-	NOFORTIO
	
	Refer to 6.2. for more		Fn	  FILE:n	n=1
	detailed information
	about this option. (**)
	
	Expect external and fortran	Y+	  TTY		on
	procedures to read from TTY	Y-	NOTTY

	Expect external and Fortran	O+	  OUTPUT	on
	procedures to write to OUTPUT	O-	NOOUTPUT

	Compile and load.			  LINK		off
						NOLINK
						  LOAD		off
						NOLOAD
	
	Compile, load and execute.		  EXECUTE	off
						NOEXECUTE
	
	Compile.				  COMPILE	on
						NOCOMPILE
	
	----------"COMPIL-class" Command-options--(PASCAL AND PASSGO)--------
	
	Enforce compilation.			  COMPILE	depends    on
						NOCOMPILE	creation date
								of  REL file
	
	Generate listing in the line printer.	  LIST		off
						NOLIST
	
	Generate cross-reference list.	  	  CREF		off
						NOCREF		
	
	----------Loader Command-options---(PASCAL and PASSGO)---------------
	
	Provide information about all		  MAP		off
	programs loaded.			NOMAP
	
	Put a program library on top 		  SEARCH <lib>	PASLIB and
	of the library search chain.				FORLIB
	(<lib> ::= <file description>)
		1.5. COMPILER DIRECTIVES (SWITCHES).	-13-
 
 
	1.5.2. Selective Use of Compiler-options
	----------------------------------------
	
	   The Compiler-options L and D can  be	used  to  selectively list
	 object code and generate information for the DEBUG-system, respectively.
	 Selective  use  of options, however, is effective only if the option
	 is not switched off before  the  END  of  a  procedure  or  function
	 (because  the	DEBUG information for a block is generated at the end
	 of its statement part).
	
	Example:
	
		 .
		 .
		 .
		(*$L+*)
		PROCEDURE P1;
		 .
		 .
		 .
		END (* P1 *);
		(*$L- MACRO-10 code is output for P1 *)
		 .
		 .
		 .
		(*$D+*)
		PROCEDURE P2;
		 .
		 .
		 .
		END (* P2 *);
		(*$D- local variables of P2 may be investigated and
		      breakpoints may be set in P2 *)
		 .
		 .
		 .
		PROCEDURE P3;
		 .
		 .
		 .
		(*$D+*)
		BEGIN (* P3 *)
		 .
		 .
		 .
		END (* P3 *);
		(*$D- only breakpoints may be set in P3 since
		      the debug option remained off during analysis of
		      the declaration part for this procedure *)
		 .
		 .
		 .
	
	 The  L-option	in  the source code is effective only if a listing is
	 requested (refer to 1.2.).
		2. THE PROGRAM HEADING.			-14-
 
 
	2. The Program Heading
	======================
	
	   Every program consists  of  a  heading  and	a  block.  The	block
	 contains  a  declaration  part   in  which  all objects local to the
	 program are defined, and  a  statement  part	which  specifies  the
	 actions to be executed upon these objects.
	
		<program> ::= <program heading> <block> .
		<block>   ::= <label declaration part>
			      <constant decl. part>
			      <type decl. part>
			      <variable decl. part>
			      <procedure/function decl. part>
			      <statement part>
	
		(for INITPROCEDURE-declaration see 5.4.)
	
	   The program heading gives the program a name.  This	name  is  not
	 significant  inside  the  program.   A  program, however, is usually
	 referred to by the name of the  file(s)  containing  the  executable
	 code  (SHR-  and  LOW-file).	 If  the program is compiled with the
	 EXTERN-option, the names of all  level-1  procedures  and  functions
	 which	are  assigned  to  be  called  from other programs have to be
	 listed  after	the program name. Notice that only six characters are
	 significant  for  all	these  names.	  They	 must	not   contain
	 '_'-characters.      The  program  heading  also  lists  the program
	 parameters  through  which  the  program   communicates   with   its
	 enviroment.
	
		<program heading> ::= PROGRAM
				      <program name>
				      [,<procedure or functiohβ⊂εsπ7∃ui(4(HH$%↓α↓↓↓αZAsCπ⊗7↔S/⊃yαmccCπK∞k↔S↔∪ru)&kX4)hQ4)h(%Is	9αO.∪OS''+S'?rβ?→β&C∃αC⊗{∨KπjαCπK∞k↔S↔↔_4(%ji555ji555ji555ji555ji555ji555ji555ji555ji44(Hh(%↓ααC?O≡K3∃πβπKπn+S↔K~βπK∃ε3'3↔~q↓ᬬαεN∞a>Bε≥~≡=↓ε3'3∃αβ[πKN3∃εKL4(Jβ'7Cf+7↔;&+⊃βπ~β¬β≠Nc∃β'rβS#∃∧"⊗∞OO≠S↔5k⊃A9α&C↔O∃ε3'3↔~β↔c'∨!β?W'≠'∪∀hP%βSF)↓βC⊗{∨Kπj↓↓#.3?K∃ε{Iβπ7#↔Iβ/C↔∂W&K?9β}qβ∪'≡Yβ?Iπ#πC∃Jβπ;⊃ε≠π9β⊗(4(%εkπ∪∃ε[π'f3∃π#=βSF)βCK};Kπ5ε∪eβS>yβπ3&+K;π&K[↔MPh($4PI↓↓!
Iαπ9ε+cS↔⊗sπ1β6K3∃β≡9β*β∂?;v+∂S↔"βS=β
↓αBε≤~ε1>∧
NN≡z↓β≠'f)β[¬hh(%↓α↓↓↓β⊗Kπ3*βeβ/≠∃β?2βS#∃π≠Sπ;&K⊃βπ∪?∂↔'+K↔M¬∩⊗N⊗"↓=αJ-:J&R*qαS#/≠∀4(J↓↓↓↓αβCK?≡+∪WK/→βπ3f{]βSzβOC↔≡K≠eβ&C∃βC⊗{C↔K&K↔Mβ}1βS#*β↔cS/∪;π1ε3'3∀hP%↓↓α↓↓↓#⊗+≠↔Iπ#=↓Us99EIrI84(Hh(%↓C⊃%↓α∞s?S#/⊃↓β←∂I↓β'_KS#∃αβOW∨#'SW&K?9↓ε3?H'&C∃β≠␈∪7π1πβπKπn+S↔K_h(%↓α↓↓↓β∨β↔∂'6K↔⊃βNqβS#*βCK??∪π5βF+π∪'v984(Hh(%α&CWM1ε	βCK};Kπ5πβπKπn+S↔IεKMβ∪.3';↔"βπMβ6{33??→h4(Hh($%gβπKπn+S↔Ir↓iiuβc≠'3*β[πKN3∃rβ?H4PH$$%f3'3∃π3πK'∞∪3∃yPh(0`$@II9ErαBJ>=∩ε5α∧
Jε6-"⊗JMpH%5E*h4)hQ4(J↓↓αSF+O∃↓ε3?K7∞aβCπ⊗7↔S/∪M↓7/C∂↔C"α&:B-!βπ;"α>VR¬*Q↓"%"eα6-~Qα:⎇!β∀hP%βOε+∂'≠N+⊃%5αβ7WO"↓β∀N#↔∂3∂∪↔⊃↓εM↓β6K3↔Mα↓β';≡K∪∃↓αβS#∃α↓βCK};Kπ5ph(%α/3↔KdN+cS↔⊗sπ1↓ε3'3∀NKMβπ/#?7π&K∂π3gI↓?ε+;↔⊃∩β←#↔rβS#∃πβK?∨⊗5β'_h(%β∨#πKS.!βeπ##∃α∃*97∂}k7π;"q↓α'2βS#∃ε3'3∃εKMβSzβ∃↓⊗{C↔;.!	β?vce↓β6{H4(Jβ';C/!1βSFKMβ#∂→βS=ε∪∃β'v#'∂π&+⊃βJβπCC.s∪';:βπ9β∂≠S↔KO≠-βSzβS#∃ε3'3∀hP%βC∂∪π7↔&+I9↓∧C?←↔6+I1β&C∃βπ∨#↔K'≡Yβ'S≡+3→↓ε#?↔Mαβ;?Qαβ∂?;∨#'SW&)↓βπwH4(%πβK?S.≠S'?r↓βπ∨∞K;OQαβ←K'&K;≥↓ε{9βSF)β≠'f)↓#Jβ¬βO.∪O↔G.+;Qα∀*↑J&$)%84PIαS#*βOW∨#'SW&K?9βO→βC↔⊗3?K7.!βeπβK?7π#';≥π##∃β/≠↔Iβ6{IβSF)β↔c&+K;π`h(%β6K3∃↓π≠C↔∂N3'∂π&K?9↓ε3?I↓ε+π∂!ε3'3∃π3πK'∞∪3∃βNqβS#*βOπ7*βO↔G.+;∂∃εL4(JβOC↔≡K≠'↔"β'9β&C∃βC⊗{∨Kπjβ#↔π&K;≥8hP$4(J↓↓αSG+M1βO!β'Mεs?Qβv+∂↔O≡Keβ&y↓?ε+9	β&C↔O∃ε3'3↔~β';ON#∃βSF)βCK};Kπ4hP%β←O#!αJ-~⊗Qβ␈⊃αJ⊗=∩&R∃ph($4PJ↔cπoβ3∃hhP$4(HJ3↔Q∧2&2:i:Bε~β∂?;&'9β&C∃β≠}c3?←Ns≥βC⊗{∨KπkP4($Hh($&¬∩>≡Jiα∞>mαεJ∀D2&2⊗~Aα~&d)E)1∧2&2∃∩Q1α>-"BVQαIl4(HJZεI∧2&2∃
aα~&d)Iiα4J2∃α|1α&:$*≡⊗IXh($%αq984PH&⊗:"p4($hP$&↔F+∂WSN{9β∂␈+3⊃β∨#πKQεMβ≠}c3?←≠P4($hP$&β6K3;πhh($&4J2∃Eβiβ∪O[SS↔O"sCπN[→AI1≠↓EVthP$&~Lb∃I↓hh($&⎇*RBV"↓uβ≠Nc;π5vcOQq≠→Mx4PH%↓9rp4($L*b&PhP$4(J↓↓α'2↓βS#*↓βK↔∂+↔OQαβ≠?Iαβ¬↓β6K3∃↓ε#↔O∂⊗KCS'}p''Mαβ∪↔≠∂+3S↔"↓β←'&Aβ∧4PIα∂π↔∪'π∨*jK↔S/∪91βO!β'MεOOWn+⊃↓7NqβS#O→↓β∂∂≠∃5↓π##πQαβ¬↓β6K3∀'v7↔⊂hP%α~Lb∃Iβ&{↔Mβ∞cK↔π'Iβ↔cO≠Q9α&C'MβO→βGWO#∃βπv3?∨␈+MβSzαJ⊗N-!"~&d)I%8hP$4(J↓↓αC⊗{∨Kπo→β←#N≠!β?vceβ7∞[∃βW≡)↓β?2↓βS#*↓βOS∞s∪πK"↓β≠'f+M↓αLrBVQαβπ;⊂hP%α>-"BVQαβ7πeαβ?7'"↓βOC.≠'≠'≡S'?rβ?→β&C∃βC∂∪π7↔&+Iβ3O≠Qβ.≠πWO*α&:B- 4(%ε;⊃α⎇*RBV"βπK∃εWS?nS'∂∞c3e↓α∪?C↔v+⊃	↓εK→↓β&C∃↓βεKπ7/#↔I↓εc'OQαβ'L4PIβ↔7π#e9↓¬##WM`h($4PH&BJ|:Jε5∧
2B"
Aα&:¬*Q)1∧zVRB-!↓%lhP$4(Jβ'Mβ/W'[∞c↔;Qπ#<4(Hh($&¬∩>≡Jiαε2∧B¬l4PH4(%∧31β&C↔O∃ε3'3↔~β7πeπ≠S'3bβ∃β⊗)7∪↔6K;↔⊃αβe↓¬∩⊗N⊗"↓β?IααJ⊗↑∀JR∃↓αkπL4PIβ7↔w#'?;.!βW;&+I↓!
I5β3∂#↔IβNqβS#*βCK??∪π58hP0$%∩qI9α$*6B∞⎇∩∃6~Lb⊗M8HH%5E2h4)hQ4(K⊃9I9¬βπOONs≥αC∂∪π7↔&+KMβ>KS!α$*6B∞⎇∩∃7≠Nc↔L4PI555ji555ji555ji555ji555ji555ji555ji555ji554hP$4(J↓↓απv{S#↔∩β←πeπ#=βC⊗{['∪*βS#∃ε∂SW∞aβCK};Kπ5πβπKπn+S↔K~β'Mβ↔Iβ7↔∞sMβ?0h(%β
αR⊗6∧~>J∃n3'3∃αBR⊗6ε{KπKJα∞>J*β≠'3*I9αSF+O∃β6K3↔MεK∀'∞c3?∂∂#↔⊃↓εK84(Jβ∂?K*βOS?⊗∨∃β∞s⊃β∂∞qβ∃ε∂∂↔∨≠↔⊃?∨∪↔πS.!β←'&C?WQπ#'7∃n≠?;O.k';≥ε#'O,hP%βK.∪M??∪'S↔~qα¬β6K3∃βNqαBε≤~ε1>∧
NN≡zβ'Mβ∂≠OW7.!βS=ε∪∃αR,jB∞>∀)7≠'f(4(%εK→β'"β'Mβ∨β↔∂'6K↔⊃β∂_4($hP$&∩≤YjbbBrR6@hP$4(JαbbaεK∃β&C∃β≠O∪OQ↓~β∂#πcters of the program name (COM.TMP  in  the
	 example above). If a core file cannot be allocated, the disk file
	
		DSK:NNNXXX.TMP
	
	 is created where NNN is the "job number".  So,  if  a	TEMPCORE-file
	 cannot be found in core, such a disk file is "looked up".
	
	Example:
		 ...
		VAR TEMPORARY_FILE: TEXT;
		 ...
		REWRITE( TEMPORARY_FILE,'ABC   TMP' );
		WRITE( TEMPORARY_FILE, ...
		 ...
		RESET( TEMPORARY_FILE );
		WHILE NOT EOF( TEMPORARY_FILE ) DO
		 BEGIN
		  IF NOT EOLN( TEMPORARY_FILE )
		  THEN READ( TEMPORARY_FILE, ...
		 ...
	
	   Notice  that  a  temporary  file  is  assigned  to  contain	short
	 information  (e.g.  pass program parameters to other programs called
	 by CALL, refer to 5.7.10.) and cannot exceed 128 words or 640	ASCII
	 characters (one DECSystem-20 disk block).
 
	   If a program is executed with the  RUN-command,  it	will  try  to
	 obtain  its program parameters from either a TEMPCORE-file or a disk
	 file with the extension CMD.	 The general input format for program
	 parameters is listed below.
	
		CMD-file or TEMPCORE-file:
	
			[<file description> [, <file description>]*]
	
		TTY:
	
			[<file description>]
	
	   If both files do not exist, it  prompts  the  user  to  enter  the
	 parameters directly at his terminal.
	
	   This  technique is used by the TOPS-20 EXEC Monitor to pass
	 parameters to the different compilers.
		3. LABELS.				-17-
 
 
	3. Labels
	=========
	
	   Any executable statement in a program may be marked	by  prefixing
	 it with a label followed by a colon.  This label must be declared in
	 the label declaration part before its use.
	
		<label declaration part> ::= LABEL <label> [,<label>] ;
	
	   A  label must be an unsigned INTEGER-constant of at most 4 digits.
	 The scope of a label is the entire block  wherein  it	is  declared.
	 That  is, a  statement  of  the  statement-part of this block may be
	 prefixed  with  the  label.	This  label  may  be  referenced   by
	 GOTO-statements   inside  the	same  statement  part  or  all	other
	 statement parts of procedures	or  functions  declared  inside  this
	 block.
	
	Example:
		 ...
	    --------------------------------------------
	    I	 PROCEDURE P0;			       I
	    I	  LABEL 11, 12, 13;		       I
	    I	   ...				       I
	    I ---------------------------------------- I
	    I I   PROCEDURE P1;			     I I
	    I I    LABEL 21;			     I I
	    I I    BEGIN (* P1 *)		     I I
	    I I      ...      		     	     I I
	    I I     21: P1;			     I I
	    I I     IF P THEN GOTO 11		(a)  I I
	    I I 	 ELSE GOTO 21		(b)  I I
	    I I      ...			     I I
	    I I    END (* P1 *);		     I I
	    I ---------------------------------------- I
	    I	  BEGIN (* P0 *)		       I
	    I	    ...				       I
	    I	   IF Q THEN GOTO 21		(c)    I   (*wrong*)
	    I		ELSE GOTO 12;		(d)    I   (*wrong*)
	    I	    ...				       I
	    I	   IF P				       I
	    I	   THEN				       I
	    I	    BEGIN			       I
	    I	     12: R;			       I
	    I	      ...			       I
	    I	    END				       I
	    I	   ELSE GOTO 13;		(e)    I   (*wrong*)
	    I	    ...				       I
	    I	   WHILE S DO			       I
	    I	    BEGIN			       I
	    I	     13: T;			       I
	    I	      ...			       I
	    I	    END;			       I
	    I	   11: U;			       I
	    I	    ...				       I
	    I	  END (* P0 *);			       I
	    --------------------------------------------
		   ...
		3. LABELS.				-18-
 
 
	 (a)	This  is  a  valid GOTO from an "inner" procedure of P0.  The
		label 11 is defined (there is a statement prefixed  with  it)
		in  its scope P0. Such a construction provides an "exit" from
		P1 to P0.
	
	 (b)	In this case the GOTO refers to a label which is declared  in
		the  same  block  (P1).    Execution  of  this	GOTO involves
		recursive activation of P1, since the statement prefixed with
		LABEL 21 is a (recursive) procedurecall of P1. If in the n-th
		recursion  step  (a)  is  executed,   the  Stack  is reset as
		follows:
	
		    Program Stack	Stack Pointer
		-----------------------------------------
		    P1		      <--- before (a)
		      n
		     .
		     .
		     .
		    P1
		      1
		    P0		      <--- after (a)
		      1
		     .
		     .
		     .
		    bottom
	
	 (c)	This GOTO is invalid because it references  a  label  outside
		its declaration scope.
	
	 (d,e)	Of  course  it is not allowed to jump into conditional (d) or
		any other structured (e) statement because the	result	could
		be undefined.
_	_	4. INPUT AND OUTPUT.			-19-

 
	4. Input and Output
	===================
	
	   Input and output is performed  by  the  standard  procedures  GET,
	 GETLN,  PUT  and  PUTLN  (for	GETLN and PUTLN refer to 5.7.14-15.).
	 Input and output to TEXT-files (PACKED FILE OF CHAR) should be  done
	 with  the  standard procedures READ, READLN, WRITE, WRITELN and PAGE
	 as described in "PASCAL - USER MANUAL AND REPORT" [1,2].  The latter
	 is called "formatted"-I/O throughout this chapter.
	
	   The DECSystem-20 mainly distinguishes two kinds of data modes  for
	 files, namely
	
	       (1) ASCII-mode with five 7-bit characters packed into one word
	
	       (2) binary-mode with a 1:1 core-to-file mapping
	
	   The following table illustrates how  PASCAL/PASSGO  file types are
	 implemented in the DECSystem-20:
	
	  File Type		Packed			Unpacked
	---------------------------------------------------------------------
	  Subrange of CHAR or	ASCII-mode,		binary-mode,
	  CHAR			"upper case",		subrange as specified
				formatted-I/O,		in file declaration
				linenumbers and 	standard-I/O
				pagemarks
	
	  Subrange of ASCII or	ASCII-mode,		as above
	  ASCII			complete 7-bit-ASCII,
				standard-I/O
	
	  other 		treated as unpacked	binary-mode,
							standard-I/O
	
	   During input from TEXT-files (PACKED FILE OF CHAR or  subrange  of
	 CHAR)	all  characters  less than ' ' -except LF and HT- are ignored
	 and all characters greater than '_' are converted to "upper case" as
	 follows:  UPPER_CHAR := CHR( ORD( INPUT_CHAR ) - 40B );
	
	 HT (TAB) is expanded to the appropriate  number  of  blanks  and  LF
	 marks the end of a line (sets EOLN to TRUE).
 
 
 
	4.1. Standard Files
	-------------------
	
	   The standard  files	INPUT,	OUTPUT	and  TTY  as  all  the	files
	 specified  as	program parameters in the program heading can be used
	 directly for input and output without having to "open" them  by  use
	 of  RESET  or REWRITE. All file variables are assigned by default to
	 the external file
	
		DSK: XXXXXX.YYY
	
	 where XXXXXX  are the first 6 characters of  the file identifier and
		4.1. STANDARD FILES.			-20-
 
 
	 YYY are the next 3 characters of it. Blanks are used  if  there  are
	 not enough characters.
	
        Example:  File Identifier	  Default Assignation
	        ---------------------------------------------
		  INPUT			  DSK: INPUT
		  OUTPUT		  DSK: OUTPUT
		  TTY			  TTY: TTY
		  AUSGABE		  DSK: AUSGAB.E
 
 
	4.2. Formatted Input/Output
	---------------------------
	
	   TEXT-files (PACKED FILE OF CHAR) can be  accessed,  as  any	other
	 file,	by  the  standard  procedures  GET and PUT. This is of course
	 quite	cumbersome  as	these  procedures  are	defined  for   single
	 character manipulation.    The procedures READ and WRITE imply a set
	 of transformation routines  that (respectively)  convert the  "TEXT"
	 pattern  of e.g. an  INTEGER-,   REAL-,  BOOLEAN-,  SET-  or string-
	 constant into the installation  dependent  internal  representation,
	 and viceversa.
 
 
	4.2.1. Formatted Input
	----------------------
	
	   The	procedures READ and READLN have non-standard parameter lists.
	 If the first parameter is a file identifier, input is done from  the
	 external file currently assigned to this file variable.    Otherwise
	 INPUT is assumed.  The number of parameters is unlimited. They  must
	 obey the restrictions on VAR-parameters, especially they must not be
	 constants or elements of packed data  structures.     The  following
	 types of variables are accepted:
	
		Type	   Restriction
	      ---------------------------------------------------------------
		INTEGER	   -MAXINT <= value <= MAXINT
		REAL	   SMALLREAL <= ABS( value ) <= MAXREAL
		CHAR	   none
		ASCII	   none
		BOOLEAN    TRUE or FALSE
		scalar	   type must be declared inside the program
		subrange   FIRST(parameter) <= value <= LAST(parameter)
		string	   must be a correct string-constant (refer to 1.4.)
		SET	   must be a correct SET-constant (refer to 1.4.)
	
	Example:  PROGRAM READER;
		  TYPE Z = (EINS,ZWEI,DREI);
		  VAR R: -13.34..13.34;
		    S: Z;
		    T: SET OF Z;
		  BEGIN
		    READ( T, R, S);
		      ...
		  END.
		4.2. FORMATTED INPUT/OUTPUT.		-21-
 
 
		If the file assigned to INPUT contains
	
		[] 15.0 EINS   or   [EINS,ZWEI] 13.0 ALPHA
	
		the following error message is given before termination:
	
		%? INPUT ERROR: SCALAR UNDEFINED OR OUT OF RANGE
		   *** 1.5000000000E+01 *** AT USER PC ...
		
		resp.
	
		%? INPUT ERROR: SCALAR UNDEFINED OR OUT OF RANGE
		   *** ALPHA *** AT USER PC ...
	
		The following input is correct:
	
		[EINS..DREI] 13.0 ZWEI
 
 
 
	4.2.2. Formatted Output
	-----------------------
	
	   If  the  first  parameter  to  WRITE  or  WRITELN  is  not  a file
	 identifier, OUTPUT is assumed. The number of  parameters  for	WRITE
	 and  WRITELN  is  unlimited.	Expressions of various types might be
	 specified.  The parameters to WRITE and WRITELN may be followed by a
	 "format  specification".   A  parameter  with	format has one of the
	 following forms:
	
		X : E1
		X : E1 : E2
		X : E1 : O
		X : E1 : H
	
	   E1  is  called the field width.   It must be an expression of type
	 INTEGER yielding a non-negative value.   For SETs  the  field	width
	 applies  to  the  SET	elements.  If no format is given, the default
	 value for E1 is for type
	
		INTEGER      12
		BOOLEAN       6
		CHAR	      1
		ASCII	      1
		REAL	     16
		ALFA	     10
		scalar	     10
		string	     the length of the string
		SET	     the default field width of the SET element type
		4.2. FORMATTED INPUT/OUTPUT.		-22-
 
 
	   Blanks  precede  the  value	to  be	printed if the field width is
	 larger than necessary to print the  value.  Depending	on  the  type
	 involved the following is printed if the field width is smaller than
	 necessary to print the value:
		INTEGER      E1 asterisks
		REAL	     E1 asterisks
		BOOLEAN      T or  F preceded  by the  appropriate number  of
			     blanks
		SET	     the default  action for the SET  element type is
			     performed
		string	     the leftmost characters fitting the field width
		scalar	     same as string
	
	Example:
	
		WRITELN( MAXINT:1, [10,20]:1 );
	
		produces the following output:
	
		*[*,*]
	
	   In the following examples, colons usually stand for blanks.
	
	   No  characters  are	printed  if the field width is 0. The minimal
	 field width for values of type REAL is 8.
	
	
	Example:
	
		WRITELN('STR':4, 'STR', 'STR':2, -12.0:10);
		WRITELN(['A'..'Z','1'..'9','+','_'],['A','B','C']:5);
		WRITELN(15:9, TRUE, FALSE:4, 'X':3);
	
		The following character sequence will be  printed:
	
		:STRSTRST-1.200E+01
		['+','1'..'9','A'..'Z','_'][::'A'..::'C']
		:::::::15::TRUE:::F::X
	
	   A value of type REAL can be printed as a fixed point number if the
	 format  with  expression  E2 is used. E2 must be of type INTEGER and
	 yield a non-negative value.   It  specifies  the  number  of  digits
	 following  the  decimal  point.    There must be enough room for the
	 fractional part, otherwise asterisks will be printed.
	
	Example:
	
		WRITE(1.23:5:2, 1.23:4:1, 1.23:6:0, 1.23:4:3);
		The  following	character  sequence will be printed:
		:1.23:1.2::::1.****
	
	   A  value of type INTEGER can be printed in octal representation if
	 the format with letter O is used. The octal representation  consists
	 of 12 digits.	 If the field width is smaller than 12, the rightmost
	 digits are used to fill the field width.   If	the  field  width  is
	 larger  than  12,  the  appropriate  number  of  blanks precedes the
	 digits.
_	_	4.3. PRINTER CONTROL CHARACTERS.	-23-
 
 
	Example:
	
		WRITE(12345B:2:O, 12345B:6:O, 12345B:15:O);
		The following character sequence will be  printed:
		45012345:::000000012345

	   A  value  of  type  INTEGER	can  also  be  printed in hexadecimal
	 representation if the format with letter H is used. The  hexadecimal
	 representation  consists of 9 digits. Using the format with letter H
	 the following character sequence will be  printed  for  the  example
	 above:
	
		E50014E5::::::0000014E5
 
 
 
	4.3. The Use of Printer Control Characters
	------------------------------------------
	
	   In some installations the first character of each line is used  as
	 a printer control character when a text file is send to the printer.
	 The first character  is  not  printed	but  instead  interpreted  as
	 controlling  the  paper feed mechanism of the printer. The following
	 (FORTRAN-) conventions are in wide use [9]:
	
		Character	ASCII		Action before Printing
	      ---------------------------------------------------------------
		' '    		LF	    	skip to next line,
						form feed after 60 lines
		'0'		LF,LF		skip one line
		'1'		FF		go to top of next page
		'2'		DLE		space 1/2 of a page
		'3'		VT		space 1/3 of a page
		'+'				overprint the line
		'*'		DC3		skip to next line,
						no form feed
		'-'		LF,LF,LF	skip two lines
		'/'		DC4		space 1/6 of a page
		'.'		DC2		triple space,
						form feed after 20 lines
		','		DC1		double space,
						form feed after 30 lines
	
	   A file containing such control characters must be printed with the
	 following command:
	
		@PRINT <file description>/FORTRAN
	
	Example:
	
		WRITELN('1','OVER');
		WRITELN('+','	 PRINT');
	
		The following output will be printed on the first line of the
		next page:
	
		OVERPRINT
		5. EXTENSIONS TO STANDARD PASCAL.	-24-
 
 
	5. Extension to STANDARD PASCAL
	===============================
 
 
 
	5.1. Standard Constants
	-----------------------
	
	   The INTEGER constants MININT and MAXINT are defined as
	
		CONST MININT = 400000000000B (* -34.359.738.368 *);
		      MAXINT = 377777777777B (* +34.359.738.367 *);
	
	 They  represent   the	smallest  and	greatest   INTEGER   in   the
	 DECSystem-20.
	
	   The REAL constants MAXREAL and SMALLREAL are defined as:
	
		CONST MAXREAL	= 1.7014118432E+38;
		      SMALLREAL = 1.4693680107E-39;
	
	 They  represent  the  absolutely  smallest and greatest REAL  in the
	 DECSystem-20.
	
	   The	ASCII  constants NUL..SP and DEL (ASCII mnemonics for special
	 control  characters)  are  primarily  intended   to   ease   special
	 I/O-operations.
	
	Example:  WRITE(TTY,BEL) instead of WRITE(TTY,CHR(07B))
	
	 They do not belong  to the PASCAL  character  set  (the  type	CHAR)
	 which is only a subset of the ASCII character set (refer to 8.5.).
 
 
 
	5.2. Standard Types
	-------------------
	
	   The	type  ASCII  represents  the total 7-bit-ASCII character set.
	 It is a superset of CHAR.
	
		TYPE ASCII = NUL..DEL;
		     CHAR  = ' '..'_';
	
	 Thus,	ASCII  and CHAR are type-compatible and assignments from CHAR
	 to ASCII and  reverse are legal  provided only  values  belonging to
	 the  subrange CHAR are assigned to a variable of that type. Refer to
	 4. and 9.1.(e) for closer information about SETs and files of ASCII.
		
	Example: ...
		VAR A: PACKED FILE OF ASCII;
		    ASC: ASCII;
		 ...
		WHILE NOT ( EOF(A) OR (A↑=LF) ) DO
		 BEGIN
		  ASC := A↑; GET(A); P(ASC);
		   ...
		5.3. STANDARD FILES.			-25-
 
 
	5.3. Standard Files
	-------------------
	
	   In  addition  to  the  standard  TEXT-files	INPUT  and OUTPUT the
	 standard TEXT-file TTY is available in LOTS PASCAL/PASSGO. 	 This
	 file  is  used to communicate with the terminal. The first parameter
	 of the standard I/O-procedures must be TTY if they are to be applied
	 to this file.
	
	   TTY	is "opened" at the beginning of  the  program.  The  user  is
	 prompted  with  the message  "TO CONTINUE, HIT THE RETURN KEY *"  to
	 indicate that input is expected (to assign a value to TTY↑).  If the
	 program does not need any input from the terminal, the message will
	 not appear at all.
	
	   TTY should only be a parameter to  the  standard  procedures  GET,
	 GETLN,  PUT,  PUTLN,  READ,  READLN,  WRITE,  WRITELN,  PAGE, BREAK,
	 GETFILENAME and GETSTATUS.   It  must	not  be  used  as  an  actual
	 parameter (VAR-parameter) of type TEXT to either declared procedures
	 and functions. If need would arise to do so, the name that should be
	 given depends on whether the procedure is going to use it for input
	 or for output. If for input,  the  name  TTY  should be used. If for
	 output, TTYOUTPUT should be used instead.
	
	Example: ...
		VAR CH: CHAR;
		 ...
		CH := TTY↑; GET( TTY );...;TTY := 'A'; PUT( TTY );
		 ...
	
	   The	standard  procedure  BREAK  (refer to 5.7.13.) is provided in
	 order to force the output to  the  terminal  even  if	the  internal
	 buffer  is  not  yet  full.
 
 
	5.4. The INITPROCEDURE
	----------------------
	
	   Variables  of  type	scalar,  subrange,  pointer,  ARRAY or RECORD
	 declared in the outermost block of a program may be  initialized  by
	 an  INITPROCEDURE.   The  body  of  an  INITPROCEDURE	contains only
	 assignment statements.   Indices as well as the assigned values must
	 be  constants.   INITPROCEDUREs can be defined ONLY in the outermost
	 block prior to the  first  procedure  or  function  definition  with
	 executable  body.   Assignment to components of packed structures is
	 ONLY possible if the components occupy a full word.
	   The definition of the INITPROCEDURE is as follows:
	
		<block> 	   ::= <declaration part>
				       <statement part>
		<declaration part> ::= <label decl. part>
				       <constant decl. part>
				       <type decl. part>
				       <variable decl. part>
				       <init part>
				       <procedure/function decl. part>
		<init part>	   ::= [<initprocedure>]*
		5.4. THE INITPROCEDURE.			-26-

 
		<initprocedure>    ::= INITPROCEDURE;
					BEGIN
					 <assignments>
					END;
 
	   The advantage of using INITPROCEDURES in LOTS PASCAL programs is
	 that they are not atctually executed: instead, the loader is
	 instructed to initialize the variables. This saves some time in the
	 execution of your program. Since PASSGO does not call the loader, 
	 there is no benefit from using INITPROCEDURES in PASSGO. The only
	 reason for their existence is to allow compatibility with PASCAL.



	5.5. The Extended CASE Statement
	--------------------------------
	
	   The CASE statement may be extended with the case OTHERS which then
	 must appear as the last case in the CASE  statement.  The  statement
	 associated  with  OTHERS  will  be executed if the expression of the
	 CASE statement does not evaluate to one of the explicitly given case
	 labels.
	
	Example:
	
		PROGRAM CASES;
		VAR X: CHAR;
		 ...
		BEGIN
		  ...
		 CASE X OF
		     'A':    P(X);
		     'B':    Q(X);
		      ...
		     OTHERS: Z(X)
		 END;
		  ...
		END.
 
 
 
	5.6. The LOOP Statement
	-----------------------
	
	   The	LOOP  statement  is  an  additional  control  statement which
	 combines the effects of the WHILE and the REPEAT statement.
	
	   The LOOP statement is defined as follows:
	
		<loop statement> ::= LOOP
				      <statement part>
				     EXIT IF <expression>;
				      <statement part>
				     END
		<statement part> ::= <statement> [;<statement>]*
	
	 The expression must result in a Boolean value.
_	_	PACK, UNPACK,DATE, TIME, CLOCK, REALTIME -27-
 
 
	5.7. Standard Procedures and Functions
	--------------------------------------
	
	   In output  examples,  colons  stand	for  blanks  throughout  this
	 Chapter.
 
 
 
	5.7.1. PACK and UNPACK
	----------------------
	
	   In addition to the first three  parameters  for  these  procedures
	 -described  in [1, 2]- two more optional parameters may be specified
	 for PACK and UNPACK, namely to indicate where in  the	packed	array
	 the  transfer	should	begin  and how many items should be packed or
	 unpacked.
	
		PACK(A, I, Z [, J [, L] ])	is equivalent to
	
		  for k := 0 to L-1 do Z[ J + k ] := A[ I + k ] ;
	
		UNPACK(Z, A, I [, J [, L] ])	is equivalent to
	
		  for k := 0 to L-1 do A[ I + k ] := Z[ J + k ] ;
	
		where the default values are
	
	    	J = LOWERBOUND( Z )  and
	    	L = 1 + MIN( UPPERBOUND( Z ) - J, UPPERBOUND( A ) - I )
 
 
 
	5.7.2. DATE and TIME
	--------------------
	
	   The procedure
	
		DATE( <alfa variable> )
	
	 assigns the current date in the format 'dd-mmm-yy ' to the parameter
	 which must be of type ALFA.
	
	   The procedure
	
		TIME( <alfa variable> )
	
	 assigns  the  daytime	in  the  format 'hh:mm:ss  ' to the parameter
	 which must be of type ALFA.
 
 
 
	5.7.3. CLOCK and REALTIME
	-------------------------
	
	   The function CLOCK returns the elapsed CPU time in  msec  and  the
	 function  REALTIME  returns  the  current  time  in msec.   Both the
	 functions have an INTEGER result type.
		FIRST, LAST, LOWERBOUND, UPPERBOUND	-28-
 
 
	5.7.4. FIRST and LAST
	---------------------
	
	   The functions
	
		FIRST( <variable> ) and
		LAST ( <variable> )
	
	 return the lowest  and  the  highest  value  (respectively)  of  the
	 (installation dependent) range of the variable type. The result type
	 of these functions depends on the type of the  parameter.  Variables
	 of any scalar type -except REAL- are accepted.
	
	Example:  PROGRAM SUBRANGE;
		  TYPE SCAL = (EINS,ZWEI,DREI,VIER);
		  VAR I: INTEGER; SI: 0..15;
		    C: CHAR; SC: 'A'..'Z';
		    S: SCAL; SS: ZWEI..DREI;
		  BEGIN
		    ...
		   WRITE( FIRST(C), LAST(I):12:O, LAST(S):5,
			  FIRST(SI), LAST(SC):2, FIRST(SS):10 );
		    ...
		  END.
	
		The following output is produced by this program:
	
		:377777777777:VIER:::::::::::0:Z::::::ZWEI
 
 
 
	5.7.5. LOWERBOUND and UPPERBOUND
	--------------------------------
	
	   The functions
	
		LOWERBOUND( <array variable> ) and
		UPPERBOUND( <array variable> )
	
	 return  the lowest resp. the highest value of the range of the index
	 type of the array. The result type depends on the index type.
	
	Example:  PROGRAM BOUNDS;
		  TYPE FARBE = (RED,YELLOW,GREEN);
		  VAR FELD: ARRAY[ 'A'..'Z', YELLOW..GREEN, 10..50 ] OF CHAR;
		  BEGIN
		    ...
		   WRITE( LOWERBOUND( FELD ):2,
			  UPPERBOUND( FELD[ 'A' ] ):6,
			  LOWERBOUND( FELD[ 'X', YELLOW ] ):3 );
		    ...
		  END.
	
		The following output is produced:
	
		:A:GREEN:10
		MIN, MAX, NEW, DISPOSE			-29-
 
 
	5.7.6. MIN and MAX
	------------------
	
	   The functions
	
		MIN( <expression>, <expression> [,<expression>]* )
		MAX( <expression>, <expression> [,<expression>]* )
	
	 return  the  minimum resp. the maximum of the expression list. Up to
	 72 expressions may be specified.  Expressions	of  any  scalar  type
	 -except BOOLEAN- are accepted. INTEGER and REAL may be mixed. If so,
	 the INTEGER-expressions are  converted  to  REAL.  The  result  type
	 depends on the type of the expressions.
	
	Example:
		PROGRAM MINMAX;
		TYPE SCAL = (KIND,VATER,MUTTER,OPA,OMA);
		VAR C: CHAR; I: INTEGER; R: REAL; S: SCAL;
		BEGIN
		  ...
		 S := VATER; C := 'X'; I := 15; R := 13.4E4;
		 WRITE( MIN(S,MUTTER),
			MAX(C,'+'):2,
			MIN(I,3):2,
			MAX(13.0,I,R):9 );
		  ...
		 END.
	
		The  following is  printed:
		VATER:X:3:1.34E+05
 
 
 
	5.7.7. NEW and DISPOSE
	----------------------
	
	   The procedures NEW and DISPOSE have the following parameter list:
	
		( <pointer variable> [,<tagfield constant>]*
				     [:<integer expression>] )
	
	   NEW allocates variables in the heap.  The  address  of  the	newly
	 allocated variable is assigned to <pointer variable>.	 If the first
	 argument is pointing to a record with variant	parts,	the  tagfield
	 constants  specifying the desired record variant may be set. In this
	 case core will be reserved  exactly  as  required  for  this  record
	 variant.  (Later  assignments	to this record must correspond to the
	 variant reserved, otherwise the heap may be overwritten in difficult
	 to  detect  cases ). If the last component is an array, the "actual"
	 size of the array  (the  number  of  components  required  for  this
	 reservation)  may  be	appended - preceeded by a colon - to the last
	 tagfield-constant.
	
	   The	corresponding  de-allocation  of the variable by DISPOSE must
	 have the IDENTICAL parameter list. If the pointer  is	undefined  or
	 out  of  the  heap,  an appropriate error message (refer to 8.4.) is
	 output before program termination.
		TRUNC, ROUND AND EXPO			-30-
 
 
	Example:
	
		 ...
		CONST MAX_DIM = 1000;
		TYPE  PTR = ↑REC
		      REC = RECORD
			     CASE INTEGER OF
			      1: ( CASE CHAR OF
				    'A': ( FIELD: ARRAY[1..MAX_DIM] OF REAL ));
				.
				.
				.
	     		     END (*REC*);
		 ...
		VAR   PTR_VAR: PTR;
		 ...
		NEW( PTR_VAR, 1, 'A': 200 ); (* occupies 200 words *)
		 ...
		DISPOSE( PTR_VAR, 1, 'A': 200 );
		 ...
	
	   The Heap is organized  like	the  Stack.  Thus,  on	DISPOSE,  all
	 variables  allocated  later  than  the disposed one are de-allocated
	 too.
	
		  Heap		Heap Pointer
		-------------------------------------------
		  V		  <- before DISPOSE( V	)
		   n				      1
		  .
		  .
		  .
		  V
		   1
		  V		  <- after DISPOSE( V  )
		   0				     1
		  .
		  .
		  .
		  bottom
 
 
 
	5.7.8. TRUNC, ROUND and EXPO
	----------------------------
	
	   The function
	
		TRUNC( <real or integer expression> )
	
	returns the greatest INTEGER less than or equal to the argument.
	
	Examples:
	
		TRUNC( -13.35)	 is -14
		TRUNC( +13.35)	 is +13
_	_	OPTION, GETOPTION			-31-
 
 
	   The function
	
		ROUND( <real or integer expression> )
	
	 returns the INTEGER nearest to the argument:
	
	   ROUND(E) := TRUNC(E+0.5);
	
	Examples:  ROUND( -0.5 ) is 0
		   ROUND( +0.5 ) is +1
	
	   The function
		
		EXPO( <real or integer expression> )
	
	 returns the INTEGER exponent of the floating point representation of
	 the argument. EXPO is defined as:
	
		expo ::= trunc(ld(abs(<real or integer expression>))) + 1
	
	Examples:  EXPO( -13.78E-22 ) is -69
		   EXPO( +1.38E15 )   is 51
		   EXPO( 1 )	   is 1
		   EXPO( 0 )	   is 0
 
 
 
	5.7.9. OPTION and GETOPTION
	---------------------------
	
	   The function
	
		OPTION( <alfa variable or alfa constant> )
	
	returns the value TRUE if the option indicated by  the	argument  has
	been   specified   by	the   user   during   program  initialization
	(substitution of the program parameters, refer to  2.  and  5.7.10.),
	otherwise FALSE is returned.
	
	Example:
	
		Let FILNAM.PAS contain the following program:
	
		PROGRAM DECIDER ( INPUT*, OUTPUT );
		 ...
		IF OPTION('STEP2     ')
		THEN P
		ELSE Q;
		 ...
		
		If the program parameters are entered like
	
		.run filnam
		INPUT = data[100,100]/step2
		OUTPUT = dskc:out.dat<055>
	
		P will be executed.
		HALT, CALL				-32-
 
 
	   The procedure
	
		GETOPTION(<alfa constant or variable>,<integer variable>)
	
	can  be used to "read" options qualified by numerical attributes. The
	value of the option is	assigned  to  the  INTEGER  variable  (second
	parameter).
	
	Example:
	
		Let FILNAM.PAS contain:
		
		PROGRAM CHOOSER ( INPUT* );
		VAR CHOOSE: INTEGER;
		 ...
		IF OPTION('TYPE      ')
		THEN
		 BEGIN
		  GETOPTION('TYPE      ',CHOOSE);
		  CASE CHOOSE OF
		      0: P(CHOOSE);
		       ...
		  END
		 END;
		 ...
		If the program parameter is entered like
	
		.run filnam
		INPUT = /type:0
	
		P(0) will be executed.
 
 
 
	5.7.10. HALT and CALL
	---------------------
	
	   The procedure
	
		HALT
	
	allows to enter the DEBUG-system from any statement of a program.  If
	the program is not compiled with the DEBUG-option, a HALT-instruction
	[8] is executed. The DEBUG-system outputs the message
	
		$STOP BY HALT IN <program name>
		$STOP IN <line>:<line>
		$
	
	   The procedure
	
		CALL(<file name and extension>,[,<device>[,<ppn>[,<core>]]])
	
	enables a  PASCAL/PASSGO programmer to start the execution of another
	(main)	program.  This	must  not  be  confounded  with  activating a
	procedure or function.	The  execution	of  the  current  program  is
	terminated  and  all  variables  local	to  this  program  are	lost.
			CALL...				-33-

 
	Execution of CALL has the same effect as issuing a RUN-command on the
	called program.  There is no return to the calling program other than
	issuing a CALL for it in the called program.  Notice  that  execution
	then will start again at the beginning of the program. Only the first
	parameter is mandatory.
	
	The parameters are used as follows:
	
	<file name and extension>
	
		  This parameter must be of type PACKED ARRAY[1..9] OF	CHAR.
		It  denotes  the  file	containing the executable code of the
		program to be called.  The first 6 characters  represent  the
		filename  and  the  last  3 characters the extension.  If the
		latter are blanks, SAV (resp. SHR or HGH and LOW) is  assumed
		(usual case).
	
	<device>
	
		  The parameter must be of type PACKED ARRAY[1..6]  OF	CHAR.
		If it is omitted, 'SYS	 ' is assumed.
	
	<ppn>
		  Refer  to  5.7.12.  for  this  parameter.  If  <device>  is
		specified as 'SYS   ', <ppn> must be 0 or defaulted.
	
	<core>
	
		  This parameter has to be of type INTEGER.  It specifies the
		amount of core for the low-segment of the called program in K
		words.
			CALL...				-34-
 
 
	Example:
	
		 ...
		IF OPTION('CREF      ')
		THEN CALL('CROSS    ','SYS   ',0,20);
		 ...
	
	   Temporary  core  files  can	be  used to pass parameters to called
	 programs (refer to 2.2.).
	
	Example:
	
		PROGRAM ONE;
		 ...
		REWRITE(OUTPUT,'TWO   TMP');
		WRITE('DATEN/RESTART'); (* here creating file TWO.TMP *)
		 ...
		REWRITE(OUTPUT,'DATEN	 ');
		WRITE(... (* here creating file DATEN *)
		 ...
		CALL('TWO      ','DSKD	',222002000B,20);
		 ...
		END.
	
		PROGRAM TWO( INPUT* );
		 ...
		READ(... (* here reading file DATEN *)
		 ...
		IF OPTION('RESTART   ')
		THEN CALL('ONE	    ','DSKE  ',302003015B,10);
		 ...
		END (* TWO *).
_	_	GETFILENAME, GETSTATUS			-35-
 
 
	5.7.11. GETFILENAME and GETSTATUS
	---------------------------------
	
	   The procedure
	
		GETFILENAME( <file variable>, <file name and extension>,
			     <protection>, <project-programmer number>,
			     <device mnemonic>, <alfa variable or constant> )
	
	 has 6 mandatory parameters.
	
	   GETFILENAME reads a DECSystem-20 file  description  (as  described
	 under	1.2.)  from the external file assigned to <file variable> and
	 assigns appropiate values to the following  four  (VAR-)  parameters
	 (refer  to 5.7.12.). The format used for the file description is the
	 same as used by the DECSystem-20 Concise Command  Language  and  for
	 program  parameters.	The  first parameter to GETFILENAME must be a
	 TEXT-file which has already been "opened" for input.
	
	   If <device> is 'TTY	 ', the user is prompted with
	
		XXXXXXXXXX=
	 to  enter  the  file  description  where  XXXXXXXXXX  is  the string
	 provided    by    the	  sixth    parameter.	  Notice    that    a
	 Carriage-Return/Line-Feed terminates the file description.
	
	   The procedure
	
		GETSTATUS( <file variable>, <file name and extension>,
			   <protection>, <project-programmer number>,
			   <device mnemonic> )
	
	 can   be   used   to	assign	 appropriate	values	  from	  the
	 "file control block"  of  <file  variable>  to  the other parameters
	 (refer to 5.7.12.).
	
	Example:If FILNAM.PAS contains
	
		PROGRAM WORK_IT_OUT( INPUT* );
		 ...
		GETFILENAME(TTY, FIL, PROT, PPN, DEV, 'SOME_FILE ');
		RESET(SOME_FILE, FIL, PROT, PPN, DEV);
		 ...
		GETSTATUS(SOME_FILE, FIL, PROT, PPN, DEV);
		IF DEV = 'DSK	'
		THEN P
		ELSE Q;
		 ...
	
		the execution could be like
	
		@filnam
		INPUT	  = dta1:data.dat
		*
		 ...
		SOME_FILE = other.dat[7,7]
		 ...
		RESET, REWRITE				-36-
 
 
	5.7.12. RESET and REWRITE
	-------------------------
	
	   A file must be "opened" with the standard procedure RESET when  it
	 is  to  be  used for reading.	It must be "opened" with the standard
	 procedure REWRITE when it is to be used for writing.
	
	 RESET and REWRITE have the following parameter list:
	
		(<file variable>, <file name and extension>, <protection>,
		 <project-programmer number>, <device mnemonic>)
	
	 Only  the  first  parameter  is  required.  The other parameters are
	 optional and used as follows:
	
	 <file name and extension>
	
		  This parameter must be of type PACKED ARRAY [1..9] OF CHAR.
		The first 6 characters are used as  file  name,  the  next  3
		characters  as	file  extension.  The  parameter  is  used to
		overwrite the current file name assigned to <file  variable>.
	
	 <protection>
	
		  This parameter  must	be  of	type  INTEGER.	  It  is  not
		necessary  for	input.	If  0  is specified, the installation
		default  value	 is   taken   (usually	<057>).    In	octal
		representation this parameter may have values from 0..777B.
	
	 <project-programmer number>
	
		  This	parameter  must  be  of  type  INTEGER.   For the PPN
		"1023,7777"  it  would	have  the  following  form  in	octal
		representation:   1023007777B.	 The job's PPN is used if the
		value is 0 or the parameter is missing.
	
	 <device mnemonic>
	
		  This parameter must be of type PACKED ARRAY [1..6] OF CHAR.
		It defines the	device	where  the  file  resides.   If  this
		parameter is missing, 'DSK   ' is assumed.
		If this parameter is specified,  new  buffer  space  will  be
		reserved  at the first free location possibly after extension
		of the low segment by the monitor. Therefore the actual  core
		requirement may grow during execution - potentially resulting
		in program termination due to insufficient core.
	
	   In the following example REWRITE is used to assign the actual file
	 TEST.LST to the file variable OUTPUT.	 The  file  is	created  with
	 protection <055>.
	
	Example:
		
		REWRITE(OUTPUT,'TEST  LST',55B)
		BREAK, MESSAGE, GETLN, GETLINENR	-37-
 
 
	5.7.13. BREAK and MESSAGE
	-------------------------
	
	   The	standard procedure BREAK is provided in order to force output
	 even if the internal buffer is not yet full.  BREAK itself does  not
	 insert  a  Carriage-Return/Line-Feed  when  used with textfiles e.g.
	 during output to the user terminal. This allows the user to type  in
	 on  the  same line where the output appeared. The line will be ended
	 by a Carriage-Return/Line-Feed only if WRITELN(TTY) was used  before
	 the call of BREAK(TTY) or BREAK (because TTY is the default argument
	 of BREAK).
	
	   If  another	file  identifier  is  indicated  as  argument  to the
	 standard procedure BREAK, output to the  appropriate  file  will  be
	 enforced  even  if  the  output  buffer is not yet full. This may be
	 advantageous if a file  identifier  refers  to  a  computer-computer
	 communication	channel as output device.  If the file is situated on
	 a directory device like DSK or DTA, the rest of the internal  buffer
	 is  filled  up with 0's.  Thus, when reading the file	the user must
	 be aware of these 0's.
	
	   The procedure
		
		MESSAGE( <argument list> )
	
	 is equivalent to
	
		WRITELN(TTY,); WRITELN(TTY, <argument list> ); BREAK(TTY);
 
 
 
	5.7.14. GETLN and GETLINENR
	---------------------------
	
	   These procedures are to be used exclusively for TEXT-files.
	
	   The procedure
	
		GETLN( <file variable> )
	
	 first advances the file to the next Line-Feed. Then it  assigns  the
	 first	character  of the next line to the variable <file variable>↑.
	 If the TEXT-file contains DECSystem-20 standard line  numbering  and
	 page  marks  [8],  the  new  line  number is placed into a dedicated
	 location in the "file control block".
	
	   The procedure
	
		GETLINENR( [<file variable>,] <line number> )
	
	 enables the user to "read" this line number. The number is  assigned
	 to  the  second  parameter  which  must be a variable of type PACKED
	 ARRAY[1..5] OF CHAR. If the first parameter  is  omitted,  INPUT  is
	 assumed. A page mark appears to the program as an empty line with no
	 line  number.	In  this  case	the  value  '	  '  is  assigned  to
	 <line number>.   An  additional  GETLN is necessary to get the first
	 relevant character of	the  next  line.  If  no  line	numbering  is
		PUTLN, PAGE, EOLN, EOF			-38-
 
 
	 provided  by  the  input  file at all, GETLINENR will return '-----'
	 constantly.

	Example:
	
		PROGRAM LINENUMBERS;
		VAR CH: CHAR;
		    LINE_NUMBER: PACKED ARRAY[1..5] OF CHAR;
		    PAGE_NUMBER: INTEGER;
		 ...
		PAGE_NUMBER := 1;
		GETLINENR(LINE_NUMBER);
		 ...
		IF EOLN
		THEN
		 LOOP
		  GETLN(INPUT);
		  GETLINENR(LINE_NUMBER)
		 EXIT IF EOF OR (LINE_NUMBER <> '     ');
		  PAGE_NUMBER := PAGE_NUMBER + 1
		 END;
		 ...
 
 
 
	5.7.15. PUTLN and PAGE
	----------------------
	
	   The procedure PUTLN( <file variable> )
	
	 writes a Carriage-Return/Line-Feed to the output file.
	
	   The procedure PAGE [( <file variable> )]
	
	   writes  a  Carriage-Return/Form-Feed  to the output file. The file
	 variable must be of type TEXT. If the parameter is defaulted, OUTPUT
	 is assumed.
 
 
 
	5.7.16. EOF and EOLN
	--------------------
	
	   The function EOF [( <file variable> )]
	
	 returns the value TRUE if the user tries to read beyond the physical
	 end of a  file,  otherwise  FALSE  is	returned.   The  contents  of
	 <file variable>↑  is	undefined if EOF is TRUE. INPUT is assumed if
	 the parameter is defaulted.
	
	   If a Line-Feed has been encountered in the input file, a blank  is
	 assigned   to	<file variable>↑  and  the  function  EOLN  [(	<file
	 variable> )] returns TRUE otherwise FALSE  is	returned.   INPUT  is
	 assumed  if no argument is provided. If the user does not care about
	 lines, linenumbers and pagemarks in his file, he does	not  have  to
	 use  GETLN or READLN to get the next line.  GET or READ invoke GETLN
	 if EOLN is TRUE. EOLN applies to TEXT-files only.
_	_	ASKFILENAME, STARTFILE			-39-


	5.7.17. ASKFILENAME and STARTFILE
	---------------------------------

	   The procedure

		ASKFILENAME( <file name and extension>, <protection>,
			     <project-programmer number>, <device mnemonic>,
			     <alfa prmpt message>, <alfa program name>,
			     <boolean flag: input file?>,
			     <boolean flag: from .TMP file?> )
			     <char variable: break character> )

	 has 9 mandatory parameters.

	   ASKFILENAME checks the file NNNXXX.TMP (where NNN is the job number,
	 and XXX the first three characters of the program name (the 6th para-
	 meter ), and then the terminal, if needed, (refer to 2.2.) to obtain
	 a VALID DECSystem-20 file description (as described in 1.2.). If an
	 invalid description is supplied, it will issue the appropriate
	 message to the terminal and keep asking. Once succeeding, it will
	 return in its four first parameters all the information about that
	 file (refer to 5.7.12.). If the terminal is prompted, the fifth 
	 parameter is used as prompt. If the seventh parameter is true, the
	 file description is expected to be for an input file, so the device
	 name LPT: will be rejected with an error message. The procedure will
	 return TRUE in the 8th parameter if the file description was 
	 successfully retrieved from a .TMP file, false if the terminal was
	 prompted. The 9th parameter is used to return the last character
	 found, which is not part of the file name itself. if eoln terminated
	 the name, a blank space (ASCII 40B) is returned.

	   The types of the parameters are, respectively: 
		PACKED ARRAY[1..9] OF CHAR, INTEGER, INTEGER,
		PACKED ARRAY[1..6] OF CHAR, ALFA, ALFA, BOOLEAN, BOOLEAN,
		CHAR

	   The procedure

		STARTFILE( <file variable>, <file name and extension>,
			   <protection>, <project-programmer number>,
			   <device mnemonic>, <boolean flag: input?>,
			   <alfa prompt message>, <default extension> )

	 has 8 mandatory parameters.

	   STARTFILE will attempt to open a file with RESET (if the 6th
	 parameter is TRUE) or REWRITE (if it is FALSE) the file passed as
	 the first parameter, using the information on it provided by the 2nd
	 to 5th parameters. If it is not successful, it will send a message
	 to the terminal, and prompt again for a new file description, using 
	 the 7th parameter as prompt, until the open succeeds. If the exten-
	 sion in the second parameter is omitted (or, later, a file name is
	 provided without an extension) and the last parameter is not blank,
	 it will try first using the 8th parameter as extension, and then,
	 if not successful, with no extension. The parameters 2nd to 5th are
	 declared VAR, so if a new file description was provided, they will
	 reflect the change on return from the call.
		SETTIME, TIMEREPORT, RUNTIME, ELAPSEDTIME -40-


	   The types of the parameters are, respectively:

		FILE, PACKED ARRAY[1..9] OF CHAR, INTEGER, INTEGER,
		PACKED ARRAY[1..6] OF CHAR, BOOLEAN, ALFA,
		PACKED ARRAY[1..3] OF CHAR

	Example:

	   The following sequence will produce the same effect as including
	 the file INFILE as a program parameter, intended for input:

		ASKFILENAME(FILENAME,PROTECTION,PPN,DEVICE,'INFILE    ',
			    'MYPROG    ',TRUE,FROMTMP);
		STARTFILE(INFILE,FILENAME,PROTECTION,PPN,DEVICE,TRUE,
			  'INFILE    ','   ');



	5.7.18. SETTIME, TIMEREPORT, RUNTIME, ELAPSEDTIME
	-------------------------------------------------

	   The procedure SETTIME

	 sets two internal variables to the current value of CLOCK and REALTIME.

	   The procedure RUNTIME( <alfa variable> )

	 assigns to the parameter the total CPU time since the last call
	 to SETTIME or to RUNTIME. The format is: 'mm:ss.mmm '.

	   The procedure ELAPSEDTIME( <alfa variable> )

	 assigns to the parameter the total real time elapsed since the last
	 call to SETTIME or ELAPSEDTIME. The format is: 'hh:mm:ss.d'.

	   The procedure TIMEREPORT( <file variable>, <alfa message> )

	 writes to the file in the first parameter the values obtained from
	 calling RUNTIME and ELAPSEDTIME, in the same format as they are
	 reported by the compiler itself. If the second parameter is not
	 blank, it will precede the time report, in the same line.

	   In all PASSGO programs, a call to SETTIME is inserted at the 
	 beginning of the code, and a call to 
	 TIMEREPORT(TTYOUTPUT, <program name> ) at the end.
		5.7.19. THE STRING PACKAGE.		-41-


	5.7.19. THE STRING PACKAGE
	--------------------------

	  The following PASCAL declarations describe the string package for 
	PASCAL and PASSGO at LOTS, as it is seen by the user. The package
	contains the following components:



	5.7.19.1 PREDECLARED TYPES AND CONSTANTS
	----------------------------------------

	   The INTEGER constant MAXSTRLEN is defined as

		CONST MAXSTRLEN = 135;

	 It represents the maximum allowed size for a string in PASCAL.

	   The subrange types STRGRANGE and STRGRANGE0 are defined as

		TYPE STRGRANGE = 1..maxstrlen;
		     STRGRANGE0 = 0..maxstrlen;

	 They represent respectively the valid values for a position in a
	 string and the valid values for the length of a string.

	   The type STRING, the core of the package, is defined as

		TYPE STRING = RECORD
			 strtext: PACKED ARRAY [1..maxstrlen] OF char;
			 len: strgrange0;
		     END;

	 It is the internal representation of a string: a packed array
	 of characters of length 135, and an integer that keeps the actual
	 length of the string value contained in it.

	   For purposes of explanation of the string package, we will use the
	 imaginary type EITHERONE, to indicate the fact that types CHAR and
	 PACKED ARRAY OF CHAR are considered compatible with type STRING, but
	 only when they are used in the value parameters to the procedures
	 and functions of this package. Notice that in the parameters that
	 are passed by reference (VAR parameters), these types are not
	 compatible. The reason is obvious.

		TYPE EITHERONE = MAGICAL MULTITYPE
					string;
					PACKED ARRAY[1..anylength] OF char;
					char;
				    END;

	   The STRING constant NULLSTR is predefined as a STRING of length
	 zero. It can be used to clear strings in conjunction with ASSIGN.
		5.7.19. THE STRING PACKAGE.		-42-
    
     
	5.7.19.2. ASSIGN, LENGTH AND POS
	--------------------------------

	   The procedure

		ASSIGN(SOURCE: EITHERONE; VAR DEST: STRING)

	 assigns to the string DEST the value of SOURCE, which can be of any
	 of the compatible types.
     
	   The function    LENGTH(SOURCE: EITHERONE): STRGRANGE0

	 returns the length of SOURCE. The type of source is any compatible
	 type.
    
	   The function    POS(STRING1, STRING2: EITHERONE): STRGRANGE0

	 returns the starting position of the first occurrence of the pattern
	 STRING1 in STRING2. if there is no occurrence, 0 is returned.
    


	5.7.19.3. SUBSTR AND CONCAT
	---------------------------

	   The procedure

		SUBSTR(SOURCE: EITHERONE; VAR DEST: STRING;
			SOURCEPOS, DESTPOS, LENG: INTEGER)
    
	 copies at most LENG characters from SOURCE to string DEST, starting
	 at position SOURCEPOS in SOURCE, DESTPOS in DEST. the data in DEST.LEN
	 will be changed if needed.
	 if SOURCEPOS + LENG is too long, only (SOURCE.LEN - SOURCEPOS + 1)
	 characters will be copied. (that is, only to the endo of SOURCE)
	 if DESTPOS + LENG - 1 > MAXSTRLEN, (attempt to extend a string over
	 the maximum allowed length), or
	 if SOURCEPOS or DESTPOS falls outside the corresponding string, an
	 error message will be sent to the terminal, and execution will be
	 suspended.

	   The procedure CONCAT (SOURCE: EITHERONE; VAR DEST: STRING)
    
	 Appends a copy of SOURCE to the end of string DEST.
	 SOURCE is not affected.
_	_	5.7.19. THE STRING PACKAGE.		-43-


	5.7.19.4. GETCHAR AND PUTCHAR
	-----------------------------

	   The function

		GETCHAR (SOURCE: EITHERONE; SOURCEPOS: STRGRANGE): CHAR;
    
	 returns the character contained in position SOURCEPOS of SOURCE.
	 if SOURCEPOS falls out of the length of the value of SOURCE, an error
	 message is sent to the terminal and execution is suspended.
     
	   The procedure

		PUTCHAR (SOURCE: CHAR; VAR DEST: STRING; DESTPOS: STRGRANGE)
    
	 puts the character SOURCE at position DESTPOS in string DEST.
	 if DESTPOS > DEST.LEN, an error message is issued and execution is
	 suspended.



	5.7.19.5. STRING COMPARISON: STRLT,STRLE,STREQ,STRGE STRGT,STRNE
	----------------------------------------------------------------
    
	   Each of the following functions returns the result of comparing
	 the value of STRING1 and STRING2, which can have any compatible
	 type. The last two letters of the name of the function indicate the
	 comparison it checks.
    
	   STRING1 is equal to STRING2 if
		1. they are of the same length, AND
		2. their characters are equal in every position.
    
	   STRING1 is greater than STRING2 if
		1. their characters are equal in positions 1, ..., x-1
		   AND STRING1 has a character in postion X which is greater
		   than the corresponding one in STRING2, OR
		2. their characters are equal in positions 1, ...,STRING2.LEN
		   AND STRING1.LEN > STRING2.LEN.
    
	 all the other functions are defined in terms of these two.

		the function				checks the operation

		STRLT(STRING1, STRING2: EITHERONE): BOOLEAN     <

		STRLE(STRING1, STRING2: EITHERONE): BOOLEAN     <=

		STREQ(STRING1, STRING2: EITHERONE): BOOLEAN     =

		STRGE(STRING1, STRING2: EITHERONE): BOOLEAN     >=

		STRGT(STRING1, STRING2: EITHERONE): BOOLEAN	>

		STRNE(STRING1, STRING2: EITHERONE): BOOLEAN     <>
		5.7.19. THE STRING PACKAGE.		-44-


	5.7.19.6. STRINGS IN READ AND WRITE
	-----------------------------------

	   The type STRING is known by the standard procedures READ and WRITE.
	 They will behave as follows:

	 READ	  takes as a string all the characters in the current line
		starting at the one currently in the file window .
		It does not do a READLN at the end.
		If eoln is true when starting, it will do ONE readln before
		reading the string (so, an empty string is a sequence of
		TWO <CRLF>).
		If there are more than 135 characters in the line, an error
		message is issued, the rest of the line is flushed, and
		execution continues.

	 WRITE    writes the contents of the string variable as it would
		do it with a packed array of char.
		5.8. PROCEDURES AND FUNCTIONS AS PARAMETERS. -45-
 
 
	5.8. Procedures and Functions as Parameters
	-------------------------------------------
	
	  (This  feature  was  implemented  in	accordance  to G.V.D. KRAATS,
	Technische Hogeschool Twente)
	
	  In  DEC-20-PASCAL/PASSGO it  is  necessary  to  declare  the formal
	parameters  of	a  formal  procedure  or  function.  An  example  may
	illustrate this:
	
	PROGRAM INTEGRATION;
	
	FUNCTION INTEGRATE ( FUNCTION F ( REAL ) : REAL;
			     LOWBOUND,
			     HIGHBOUND,
			     DELTA_X : REAL ) : REAL;
	
	VAR X,SUM : REAL;
	
	BEGIN (*INTEGRATE*)
	  (* ASSUME : LOWBOUND < HIGHBOUND AND DELTA_X > 0 *)
	  SUM := 0;
	  X := LOWBOUND;
	  WHILE X < HIGHBOUND DO
	   BEGIN
	    SUM := SUM + F(X) * DELTA_X;
	    X := X + DELTA_X
	   END;
	  INTEGRATE := SUM
	END (*INTEGRATE*);
	
	FUNCTION SINUS (ARGUMENT : REAL) : REAL;
	
	BEGIN (*SINUS*)
	  SINUS := SIN(ARGUMENT)
	END (*SINUS*);
	
	BEGIN (*INTEGRATION*)
	  WRITELN( INTEGRATE(SINUS, 0, 3.14, 0.01) : 6 : 3)
	END (*INTEGRATION*).
	
	Note that:
	a) at the declaration of "F" no identifier is required for the formal
	   parameter  of  "F",	only the type(s) of the argument(s) of formal
	   procedures and functions must be specified.
	b) at  a  call	no actual parameters must be specified for procedures
	   and	functions  which  serve  as  procedure/function   parameters.
	   (Obviously,	a  function  which appears at the position of a value
	   parameter must have parameters .)
	
	  The  declaration of "formal formal parameters" is necessary for the
	compiler to check the actual procedure- and function- parameters with
	respect  to  their  parameters	and types. This avoids a considerable
	overhead  of  parameter-  and	type-checking	at   runtime   of   a
	PASCAL-program.
		5.8. PROCEDURES AND FUNCTIONS AS PARAMETERS. -46-
 
 
	The syntax of DEC-20-PASCAL/PASSGO is extended as follows:
	
	<procedure heading>		 ::=
	  PROCEDURE <identifier> [<formal parameterlist>] ;
	<function heading>		 ::=
	  FUNCTION  <identifier> [<formal parameterlist>] :
					    <type identifier> ;
	<formal parameterlist>		 ::=
	  ( <formal parametersection> [ ; <formal parametersection> ]*)
	<formal parametersection>	 ::=
	  [VAR] <identifierlist> : <type identifier> |
	  PROCEDURE <identifierlist> [<formal formal parameterlist>] |
	  FUNCTION <identifierlist> [<formal formal parameterlist>] :
						     <type identifier>
	<identifierlist>		 ::=
	  <identifier> [ , <identifier> ]*
	<formal formal parameterlist>	 ::=
	  ( <formal formal parametersection>
			    [ ; <formal formal parametersection> ]* )
	<formal formal parametersection> ::=
	  [VAR :] <type identifier> |
	  PROCEDURE [<formal formal parameterlist>] |
	  FUNCTION  [<formal formal parameterlist>] : <type identifier>
	
	
	Important Notes:
	----------------
	
	a) External procedures and functions which are not written in  PASCAL
	   must not  be  used  as  actual  parameters to formal procedures or
	   functions since they obey different parameterconventions.
	b) Standard-procedures	and  -functions  are  not  allowed  as actual
	   parameters to formal procedure  and	function  parameters  because
	   most of them either
	   *) have parameterlists of variable length (e.g. WRITE) or
	   *) have parameters of varying types (e.g. PUT) or
	   *) are  implemented	as FORTRAN- or MACRO10-subroutines (e.g. SIN)
	      or
	   *) generate	in-line  code  that  cannot  be  passed  as an actual
	      parameter(e.g. PRED).
	
	  In  these cases one may declare a PASCAL-procedure which only calls
	the appropriate standard or external (non-PASCAL)  procedure  (as  in
	the example above).
_	_	6. EXTERNAL PROGRAMS.			-47-
 
 
	6. External Programs	IMPORTANT: Not Allowed in PASSGO.
	====================
	
	   DECSystem-20   PASCAL  provides  a  facility  to  access  external
	 procedures and functions that exist outside  the  user  program  and
	 have  been  separately compiled.  This enables the PASCAL programmer
	 to access program libraries.
 
 
 
	6.1. Declaration of External Procedures or Functions
	----------------------------------------------------
	
	   The	declaration  of  such  a  procedure or function consists of a
	 heading  followed  by	the  word  EXTERN  or	FORTRAN.   Thus   the
	 procedure/function declaration is extended to the following:
	
		<proc./func. decl.> ::= <proc./func. heading>;
					<proc./func. block>;
		<proc./func. block> ::= <block> or
					EXTERN or
					FORTRAN
 
 
 
	6.2. How to Compile External Programs
	-------------------------------------
	
	   External programs must be compiled  with  the  EXTERN-option.  The
	 statement  part of an external program (usually referred to as "main
	 program") should only consist of
	
		BEGIN END
	 because it cannot be executed if the program is  compiled  with  the
	 EXTERN-option.  Example:
	
	PROGRAM MAIN;
		VAR R: REAL;
		 ...
		FUNCTION SINUS( X: REAL ): REAL; EXTERN;
		BEGIN (* MAIN *)
		 ...
		WRITE( TTY, SINUS( R ) );
		 ...
		END.
	
		(*$E+*)
		PROGRAM FUNCTIONS, SINUS, COSINUS...
		 ...
		FUNCTION SINUS( ARG: REAL ): REAL;
		 ...
		BEGIN (* SINUS *)
		 ...
		END;
		 ...
		BEGIN (* FUNCTIONS *)
		END.
		6.2. HOW TO COMPILE EXTERNAL PROGRAMS.	-48-
 
 
	   It  is also possible to call external FORTRAN subroutines.  If the
	 FORTRAN I/O-routines are needed, the  calling	PASCAL	main  program
	 must be compiled with the FORTIO-option.
	
	Example:
		The program
	
		PROGRAM MAIN;
		 ...
		PROCEDURE FORPRO( ... ); FORTRAN;
		 ...
		END.
	
		must be compiled like
	
		@pascal
		OBJECT =
		LIST =
		SOURCE = main/fortio/runcore:10/list
		@compile forpro.for/list
		@load main,forpro/map
	
	 Notice that the FORTRAN I/O-routines require at least	6K    of  the
	 high-segment core.
	
	   Inside external PASCAL programs the standard file variables INPUT,
	 OUTPUT  and TTY are also pre-declared. They access the same files as
	 they do in the PASCAL main program.
	
	   A list of program parameters is ignored for external programs  but
	 on  principle	it  is	allowed  to  declare  file  variables in such
	 programs. In this  case  the  program	must  be  compiled  with  the
	 FILE-option  to guarantee a unique assignation of "data channels" to
	 the files. If there are e.g. 3 files -except standard files- already
	 declared  in  the  calling  main  program, the FILE-option has to be
	 specified as
	
		/FILE:4
	
	 The  value  of  the FILE-option -default 1- must not be greater than
	 12.
 
 
 
	6.3. How to Create a Program Library
	------------------------------------
	
	   A  program  library	containing  the  REL-files of external PASCAL
	 programs can be easily created just by providing a  file  containing
	 the  source  code  of all these programs to the compiler. The PASCAL
	 compiler accepts a program library for compilation.
	
		<program library> ::= <program> [<program>]*
		<program>	  ::= <program heading> <block> .
		6.3. HOW TO CREATE A PROGRAM LIBRARY.	-49-
 
 
	   Other  modules like FORTRAN subroutines or MACRO-10 routines (such
	 routines must correspond in their calling  sequence  either  to  the
	 conventions  for  a  PASCAL  procedure or function or to those for a
	 FORTRAN  subroutine)  can  be	added  to  the	 library   with   the
	 FUDGE2-program [8].

	   Each  of  the  programs  must  start  on a separate line because a
	 READLN is performed by the compiler when the program  end  has  been
	 encountered.
	
	   The E-option cannot be reset inside a program library.
	
	Example:
	
		Let PROGLB.PAS contain
	
		(*$E+*)
		PROGRAM P1, E11, E12;
		 ...
		BEGIN (* P1 *)
		 ...
		END (* P1 *) .
		PROGRAM P2, E21, E22;
		 ...
		BEGIN (* P2 *)
		 ...
		END (* P2 *) .
	
		The program library is created with
	
		@compile proglb/list
		PASCAL: PROGLB [P1: E11, E12]
		 ...
		PASCAL: PROGLB [P2: E21, E22]
		 ...
	
		The  library  can  be  examined   and	modified   with   the
		FUDGE2-program
	
		@fudge2
		*tty:=proglb.rel/s$
		P1	E11 E12
		P2	E21 E22
		*↑C
	
		Now programs can be loaded in "library search mode" like
	
		@compile filnam/list
		@load filnam,/search proglb/map
		7. THE PASCAL DEBUG-SYSTEM.		-50-
 
 
	7. The PASCAL DEBUG-system  [10]
	================================
	
	   The	PASCAL DEBUG-system is only accessible to programs which have
	 been compiled with the DEBUG-option.  The system can be used to  set
	 breakpoints   at   specified  linenumbers.   When  a  breakpoint  is
	 encountered, program execution is  suspended  and  variables  (using
	 normal  PASCAL  notation)  may  be  examined  and  new values may be
	 assigned to  them.   Also  additional	breakpoints  may  be  set  or
	 breakpoints  may  be cleared. It is helpful to have a listing of the
	 program available as the system is linenumber oriented. The  program
	 should  be  saved  with w having a value of at least u + v + 15 (see
	 Section 1.3.).
 
 
 
	7.1. Commands
	-------------
	
	   The	commands  described here can be used when the system enters a
	 breakpoint.  When the program is executed it will  respond  with  an
	 asterisk  if input from TTY is required. After a Carriage-Return has
	 been typed, the initial breakpoint  (set  by  the  system)  will  be
	 entered with the message
	
		$DEBUG: <program name>
		$
	
	   Additional breakpoints are set by
	
		 STOP <line>
	
	 where <line> is of the form linenumber/pagenumber or just linenumber
	 which is equivalent to linenumber/1 -	e.g.: 120/3 - . A  maximum of
	 20 breakpoints may be set simultaneously.
	
	 The breakpoint is cleared by
	
		 STOP NOT <line>
	
	 The breakpoints set may be listed by
	
		 STOP LIST
	
	   Variables may be examined by the command
	
		 <variable> =
	
	 <variable> may be any variable as allowed by  the PASCAL definition.
	 In particular it may be just a component of a structured variable or
	 the whole structure itself. The  buffer-variable  FILNAM↑  connected
	 with  the  file  identifier  FILNAM  as  well as the file identifier
	 itself can be accessed. If the  file  identifier  is  examined,  the
	 contents of the "file control block" are given.
_	_	7.1. COMMANDS.				-51-
 
 
	   The command [12]
	
		 STACKDUMP
	
	 will generate a TEXT-file with a source-level dump  of  the  current
	 stack content. If the DEBUG-option has been switched off locally  in
	 the program text, the error message "There is no  information	about
	 this part of the program" may be output. Similarly , the command
	
		 HEAPDUMP
	
	 will generate a TEXT-file with a source-level dump  of  the  current
	 heap content. If the DEBUG-option has been switched off locally, the
	 error messages "can't continue the heap dump" or "type of referenced
	 variable  not	known"	might appear. After STACKDUMP or HEAPDUMP the
	 Debug-system outputs the message
	
		$LOOK FOR DUMP ON FILE XXXXXX.PMD
	
	 where XXXXXX is some fantasy name.
	
	   A ew value may be assigned to a variable by
	
		 <variable> := <variable or constant>
	
	 The assignment follows the usual type rules of PASCAL.
	
	   The currently active call sequence of procedures and functions  is
	 obtained by
	
		 TRACE
	
	 The names of the procedures and functions together with line numbers
	 of  their  activation	are  printed  in  reverse  order   of	their
	 activation.
	
	   Program execution is continued by the command
	
		 END
	
	 The  program  will  run until another breakpoint is encountered. The
	 breakpoint is announced by
	
		$STOP AT <line>
		$
		7.2. PROGRAM INTERRUPTS.		-52-
 
 
	7.2. Program Interrupts
	-----------------------
	
	   If a program -compiled with the DEBUG-option-  is  interrupted  by
	 any run-time error (refer to 8.4.) or by
	
		↑C↑C
	
	 the DEBUG-system is usually automatically entered or -if not- it  is
	 possible  to  (re-)  enter the DEBUG-system with the monitor command
	 DDT. The DEBUG-system outputs the message
	
		$STOP BY RUNTIME ERROR IN <program name>
		$STOP IN <line>:<line>
		$
	
		or
	
		$STOP BY DDT COMMAND IN <program name>
		$STOP IN <line>:<line>
		$
	
	   If the program is running in "batch	mode",	the  DEBUG-system  is
	 automatically entered and a Post-Mortem dump is generated.
 
 
 
	7.3. How to Debug External Programs	NOTE: No Externals in PASSGO.
	-----------------------------------
	
	   If the main program and/or several  external  programs  have  been
	 compiled  with  the  DEBUG-option,  it  is the loading sequence -the
	 sequence  in  which  the programs are specified  in the LOAD-command
	 that indicates which program is to  be  debugged.   ONLY  the	first
	 program in the loading sequence may be debugged provided it has been
	 compiled with the DEBUG-option.
	
	Example:
	
		@LOAD MAIN, P1, P2		MAIN can be debugged
		@LOAD P1, MAIN, P2		now P1 can be debugged
		8. TABLES.				-53-
 
 
	8. Tables
	=========
 
	8.1. Operations
	---------------
 
	8.1.1. Summary
	--------------
	
	Operator	Operation	Type of Operand(s)	Result Type
	----------Arithmetic-------------------------------------------------
	
	  + (unary)	identity	INTEGER or REAL		same as
								operand
	  - (unary)	sign inversion			
	  +		addition				INTEGER or
								REAL
	  -		subtraction		
	  *		multiplication
	  /		REAL division				REAL
	  DIV		INTEGER div.	INTEGER			INTEGER
	  MOD		modulus		INTEGER		
	
	----------Relational-------------------------------------------------
	
	  =		equality	any scalar, string,	BOOLEAN
					SET or pointer
	  <>		inequality	
	  <		less-than	any scalar or string
	  >		greater-than	
	  <=		less-equal,	any scalar, string,
			set inclusion	or SET
	  >=		greater-equal,
			set inclusion
	  IN		set membership	1st op. scalar,
					2nd op. its SET type
	
	----------Logical----------------------------------------------------
	
	  NOT		negation	BOOLEAN			BOOLEAN
	  OR		disjunction	
	  AND		conjunction
	
	----------SET--------------------------------------------------------
	
	  +		set union	SET			same type
	  -		set difference	
	  *		set intersection
	
	----------Assignment-------------------------------------------------
	
	  :=		assignment	any compatible types	---
					except file types
	
	   If both INTEGER and REAL values appear in expressions, the  result
	 type is always REAL.
		8.1. OPERATIONS.			-54-
 
 
	8.1.2. Precedence
	-----------------
	
			Arithmetic 	Logical		SET
	
		--------------------------------------------------------
	
		1st	  + (unary)	  NOT
			  - (unary)
	
		--------------------------------------------------------
	
		2nd	  MOD, DIV,	  AND		  *
			  *, /
	
		--------------------------------------------------------
	
		3rd	  +, -		  OR		  +, -
	
		--------------------------------------------------------
	
		4th	  =, <, <=,	  =, <, <=,	  <=, >=, IN
			  <>, >, >=	  <>, >, >=
	
		--------------------------------------------------------
 
 
 
	8.2. Reserved Words
	-------------------
	
	  IF, DO, OF, TO, IN, OR,
	
	  END, FOR, VAR, DIV, MOD, SET, AND, NOT,
	
	  THEN, ELSE, WITH, GOTO, LOOP, CASE, TYPE, FILE, EXIT,
	
	  BEGIN, UNTIL, WHILE, ARRAY, CONST, LABEL,
	
	  EXTERN, RECORD, DOWNTO, PACKED, OTHERS, REPEAT,
	
	  FORTRAN, FORWARD, PROGRAM,
	
	  FUNCTION,
	
	  PROCEDURE, SEGMENTED,
	
	  INITPROCEDURE
_	_	8.3. STANDARD PROCEDURES AND FUNCTIONS.	-55-
 
 
	8.3. Standard Procedures and Functions
	--------------------------------------
 
	8.3.1. Procedures
	-----------------
	
	   Procedures marked with (*) are also defined	in  PASCAL  6000-3.4,
	 those marked with  (**)  only  in  DEC-20 PASCAL/PASSGO.  The marked
	 procedures and functions are not part of STANDARD PASCAL.
	
	  Input/Output:
		RESET, REWRITE, GET, PUT, PAGE, READ, READLN, WRITE, WRITELN,
		MESSAGE (*), GETLN (**), PUTLN (**), GETLINENR (**),
		BREAK (**)
	
	  Execution Control:
		HALT (*), CALL (**)
	
	  Allocation of Dynamic Storage:
		NEW, DISPOSE (*)
	
	  Communication with the Enviroment:
		DATE (*), TIME (*), GETFILENAME (**), GETSTATUS (**),
		GETOPTION (**), ASKFILENAME (**), STARTFILE (**),
		SETTIME (**), RUNTIME (**), ELAPSEDTIME (**), TIMEREPORT (**)

	 String Package:
		ASSIGN (**), SUBSTR(**), CONCAT(**), PUTCHAR(**)
 
 
	8.3.2. Functions
	----------------
	
	Function 	Type of Argument(s)		Result Type
	
	----------STANDARD PASCAL--------------------------------------------
	
	ARCTAN		INTEGER or REAL			REAL
	COS
	EXP
	LN
	SIN
	SQRT
	
	ABS						INTEGER or REAL
	SQR						
	
	ROUND						INTEGER
	TRUNC					 	INTEGER
	
	ODD		INTEGER				BOOLEAN
	
	EOF		any file			
	EOLN		TEXT 		
	
	PRED		any scalar except REAL		argument type
	SUCC			
		8.3. STANDARD PROCEDURES AND FUNCTIONS. -56-	
 
 
	Function 	Type of Argument(s)		Result Type
	
	----------STANDARD PASCAL--------------------------------------------
	
	CHR		INTEGER				CHAR
	ORD		any scalar or pointer		INTEGER

	----------PASCAL 6000-3.4--------------------------------------------
	
	CARD		any SET				INTEGER
	CLOCK		---				
	EXPO		REAL				
	
	----------DEC-20 PASCAL/PASSGO---------------------------------------
	
	ARCCOS		INTEGER or REAL			REAL
	ARCSIN
	COSD
	COSH
	LOG
	RANDOM						0.0..1.0
	SIND						REAL
	SINH
	TANH
	
	REALTIME	---				INTEGER
	OPTION		ALFA				BOOLEAN
	
	FIRST		any scalar except REAL		argument type
	LAST
	
	LOWERBOUND	array				array index type
	UPPERBOUND
	
	MIN		any scalar except BOOLEAN	scalar type
	MAX

	LENGTH		String (String Package)		integer
	POS		String (String Package)		integer
	STRLT		Strings (String Package)	boolean
	STRLE		Strings (String Package)	boolean
	STREQ		Strings (String Package)	boolean
	STRGE		Strings (String Package)	boolean
	STRGT		Strings (String Package)	boolean
	STRNE		Strings (String Package)	boolean
	
	   If  both  INTEGER  and REAL values appear in the argument list for
	 MIN or MAX, the result type is REAL.
		8.4. RUN-TIME ERROR MESSAGES.		-57-
 
 
	8.4. Run-time Error Messages
	----------------------------
	
	   The	run-time  error  messages of the PASCAL run-time support have
	 the general format
	
		%? <message text> AT USER PC <octal address>
	
	 The following is a list of  all  run-time  messages  that  might  be
	 output during execution of a PASCAL program.
	
	Address Checks:
	
		POINTER OUT OF BOUNDS: CANNOT RETAIN VARIABLE
		HEAP OVERRUNS STACK: RETRY WITH MORE CORE
		NOT ENOUGH CORE TO READ TEMPCORE-FILE <file name>
		STACK OVERRUNS HEAP: RETRY WITH MORE CORE
		CORE REQUIREMENT GREATER THAN "CORMAX"
		ARRAY INDEX OUT OF BOUNDS
		
	DEBUG-system:
	
		PROGRAMS COMPILED WITH THE DEBUG-OPTION MUST NOT BE SHARABLE:
		   RETRY WITH .SAVE INSTEAD OF .SSAVE
		ILLEGAL MEMORY REFERENCE
		TIME LIMIT EXCEEDED
		DEBUG-SYSTEM ERROR: <error number>
		
	Input/Output:
	
		INPUT ERROR: INVALID SCALAR SPECIFICATION *** <scalar> ***
		INPUT ERROR: SCALAR UNDEFINED OR OUT OF RANGE
		   *** <scalar> ***
		INPUT ERROR: INVALID SET SPECIFICATION
		INPUT ERROR: SET ELEMENT SPECIFIED TWICE *** <scalar> ***
		NO ACCESS TO OR NO DISK SPACE FOR FILE <file name>:
		   ERROR IN REWRITE
		REWRITE FOR FILE <file name> REQUIRED
		INPUT ERROR: ATTEMPT TO READ BEYOND EOF OF <file name>
		INPUT ERROR: RESET REQUIRED FOR <file name>
		INPUT DATA ERROR IN FILE <file name>
		SCALAR OUT OF RANGE IN FILE <file name>
		OUTPUT ERROR: DISK SPACE EXHAUSTED FOR FILE <file name>
		
	Arithmetic Operations:
	
		ARITHMETIC OVERFLOW OR ZERODIVIDE
		SCALAR OUT OF RANGE
		MORE THAN 72 SET ELEMENTS
	
	Program Parameters:
	
		NO ACCESS TO <file name> OR NOT FOUND: REENTER
		SYNTAX ERROR: REENTER
	
	Program Execution:
	
		CANNOT RUN <file name>
		8.5. ASCII TABLE.			-58-
 
 
	8.5. ASCII Table
	----------------
	
	   The PASCAL character set (the  type	CHAR)  is  encircled  in  the
	 following table.
	
		    0	1   2	3   4	5   6	7
		00  NUL SOH STX ETX EOT ENQ ACK BEL
		01  BS	HT  LF	VT  FF	CR  SO	SI
		02  DLE DC1 DC2 DC3 DC4 NAK SYN ETB
		03  CAN EM  SUB ESC FS	GS  RS	US
	      ---------------------------------------
	      | 04  SP	!   "	#   $	%   &	'   |
	      | 05  (	)   *	+   ,	-   .	/   |
	      | 06  0	1   2	3   4	5   6	7   |
	      | 07  8	9   :	;   <	=   >	?   |
	      | 10  @	A   B	C   D	E   F	G   |
	      | 11  H	I   J	K   L	M   N	O   |
	      | 12  P	Q   R	S   T	U   V	W   |
	      | 13  X	Y   Z	[   \	]   ↑	_   |
	      ---------------------------------------
		14  `	a   b	c   d	e   f	g
		15  h	i   j	k   l	m   n	o
		16  p	q   r	s   t	u   v	w
		17  x	y   z	{   |		DEL
_	_	9. MISCELLANEOUS.			-59-
 
 
	9. Miscellaneous
	=================
 
 
 
	9.1. Implementation Restrictions
	--------------------------------
	
	 (a)  A maximum of 12 files may be declared by the user.
	
	 (b)  Arrays of files and records with files as  components  are  not
	      implemented.
	
	 (c)  Segmented files are not implemented.
	
	 (d)  Call of external COBOL or ALGOL procedures or functions are not
	      implemented.
	
	 (e)  A  SET  may  contain  a  maximum	of  72	elements of scalar or
	      subrange types -except REAL-.  Thus, SETs of ASCII or   INTEGER
	      are not possible. Only subranges consisting of not more than 72
	      values are allowed (e.g.	 CHAR).    The	following  rules  are
	      valid for these subranges:
		
		  Range Type	Restriction
		-----------------------------------------------------
		    ASCII or	  ORD(FIRST(<subrange>)) >= 40B and
		    CHAR	  ORD(LAST(<subrange>))  <= 137B
	
		    other  	  ORD(FIRST(<subrange>)) >= 0	and
				  ORD(LAST(<subrange>))  <= 71
	
	 (f)  A range of SET-elements in a set must be given  using  constant
	      bounds only (no expression as bound is allowed).
 
 
 
	9.2. Known Bugs
	---------------
	
	
	 (a)  Comparison  of entire variables of type PACKED RECORD or PACKED
	      ARRAY may cause errors if these	variables  are	used  with  a
	      variant part.
	
	 (b)  Alphabetical ordering of PACKED ARRAY [1..n] OF CHAR may result
	      in  a  different	ordering  from	that  obtained	with the same
	      character sequences represented simply as ARRAY [1..n] OF CHAR.
	      (This  is  due to the fact that the most significant bit of the
	      first character in a word represents the sign  bit  during  the
	      arithmetic  word-compare used for PACKED ARRAY's whereas it has
	      no such influence for ARRAY [1..n] OF CHAR which	are  compared
	      character by character).
		9.3. UTILITY PROGRAMS: PCREF.		-60-
 
 
	9.3. Utility Programs: PCREF
	----------------------------
		
	  Pascal has a cross-referencing program called PCREF. It outputs a file
	called CROSSLIST, which consists of (a) a prettyprinted version of the
	program, showing in the left margin the relations between BEGIN..END
	pairs, THEN..ELSE pairs, etc. (b) a cross reference of all the identifiers, 
	(c) a report of procedure and function declaration nesting,
	(d) a report of proc-func call nesting.
	
	  TO USE IT:	You can (a) use the /CREF switch when @EXECUTEing your
	program or calling @PASCAL, (b) call it directly by typing @PCREF,
	or (c) use the /PROFILE switch when @EXEC, in which case CROSSLIST
	will contain the execution counts for each basic block.
	In the first case, PCREF will be called immediately after compilation.
	PCREF will ask you for the names of the files. At that moment, you can
	also give any switches you want to use. Here are two sample calls:
	
		@pcross
		OLDSOURCE= myprog.pas/case:u
		CROSSLIST= /nocross
	
		@exec myprog/cref

	  In the first one you are calling PCREF directly, to generate a new
	version of the source myprog.pas, forcing all the text to be upper
	case. In the second one you call it at compilation time, sending the
	cross references to the file myprog.lst.
	
	  The default casing is as follows:
	
		Reserved words:		Upper case.
		Strings:		Upper case.
		Comments:		Lower case.
		Other words:		Lower case.
	
	  You can change the case by using the appropriate switches. Since 
	PASCAL programs see all input in upper case, there is no way to
	let the output look exactly like the input.
	
		9.3.1. SWITCHES.			-61-
 
 
	9.3.1. Switches
	---------------
	
					NOTE:   Brackets indicate optional.
	   					<n> stands for an integer.
	   					<L> stands for a letter.

	   Switch	   Meaning				       Default.
	
	--------FILES--------------------------------------------------------
	/[NO]NEW          writting of the newsource file                 on
	/[NO]CROSS[:<n>]  writting of the crosslist file.              on,15
	                 <n> is the sum of:
	                       1   source program listing
	                       2   listing of identifiers
	                       4   listing of proc-func
	                           declaration nesting.
	                       8   listing of proc-func call nesting.
	--------PAGE AND LINE FORMAT-----------------------------------------
	/WIDTH:<n>      page width for crosslist. (minimum: 40)        132
	/INDENT:<n>     indentation between levels.                    4
	/INCREMENT:<n>  line number increment                          100
	/[NO]DOTS       put as a guide a dotted line at the left
	                margin every fifth line                        on
	/[NO]HEAD	break the file in pages with headers for print on
	/LINES:<N>      number of lines per page                       57
	--------STATEMENT FORMAT---------------------------------------------
	/BEGIN:[-]<n>   if the [-] is not there, the contents of a
	                  begin..end block is indented n spaces further.
	                if it is there, the block will not be indented,
	                  but the begin and end statements will be
	                  exdented n spaces.                           0
	/[NO]FORCE      forces newline in standard places. (before and
	                 after begin, end, then, else, repeat, etc.)   off
	/[NO]CLEAN      converts the symbols for begin and end of
	                 comment from old standards to 
			 '('-'*' and '*'-')'     		       on
	     
	        UPPER AND LOWER CASE
	                       note: the possible values for <l> are:
	                               u means upper case
	                               l means lower case.
	     
	/RES:<l>        case used for reserved words.                  u
	/NONRES:<l>     same for non-reserved words.                   l
	/COMM:<l>       same for comments.                             l
	/STR:<l>        same for strings.                              u
	/CASE:<l>       resets all the defaults to <l>.                off
	---------------------------------------------------------------------

	NOTE: IF A FILE .KNT IS FOUND, THE STATEMENT COUNTS FROM 
		PROFILING THE PROGRAM WILL BE INSERTED, AND THE
		DEFAULT OF THE FOLLOWING SWITCHES WILL CHANGE:

	/CROSS	1 if not mentioned explicitly, 15 if asked for.
	/FORCE	ON
		9.3.2. READING THE OUTPUT.		-62-
 
 
	9.3.2. Reading the Output
	-------------------------

	The cross-reference file CROSSLIST contains 4 parts:

	   1. THE PROGRAM LISTING:

	the letters and numbers in the left margin indicate the presence of
	reserved words which have to match. (BEGIN-END, etc.) The two words
	that match according with the scope rules will have the same number.
	The first one (e. g., BEGIN) will appear at left, and the second one
	(e.g., END) at right, inside the margin. The letters mean:
		B  Begin	E end
		I  If		T  Then		S Else
		L  Loop		X  Exit		E End
		C  Case		E  End
		R  Repeat	U  Until
	If PCROSS was called by using the /PROFILE switch when calling PASCAL
	or PASSGO, or if a file with extension .KNT exists, it will take
	information from that file and include some counts on the left margin,
	right after the line numbers. Each number in this column indicates
	the number of times that the basic block that starts in that line
	was executed. Basic block is a sequence of statements with no branches
	(No IFs, GOTOs, or changes of looping scope. WITH does not start a
	Basic Block.).

	   2. THE CROSS REFERENCE LISTING OF IDENTIFIERS:

	It is ordered alphabetically. For each identifier it contains:
	    a. A 'P' or 'F' if it is a procedure or function, respectively.
	    b. The name of the identifier, up to 10 symbols.
	    c. The line numbers in which it occur. Those lines in which
		  it is declared are marked with a D; those in which it
		  occurs more than once are marked with an M (Multiple).

	   3. THE NESTING OF PROCEDURE-FUNCTION DECLARATION:

	It describes the static links. The scope is shown by indentation.
	Each line describes a procedure or function and contains:
	    a. The name.
	    b. an (M), (P) or (F) if it is the main program, a procedure
		  or a function, respectively.
	    c. If there are more than one procedure-function with the same
		  name (in different scopes, which is perfectly valid, but
		  a horrible thing to do), a D  (for DOUBLE) appears next,
		  and the rest of the information in this and the next part
		  of the listing contains data on both (or all of them, if
		  there are more than one.).
	    d. If it is an external procedure, an E will appear next.
	    e. The line number where the header appeared.
	    f. The line number of the BEGIN statement.
	    g. The line number of the END statement.

_	_	9.3.2. READING THE OUTPUT.		-63-


	   4. THE NESTING OF PROCEDURE-FUNCTION CALLS:

	It describes the dynamic links. Calling depth is indicated by 
	indenting. The format of each line is the same as in the previous
	report, except for the following:
	    a. Lines are numbered.
	    b. A procedure can be called from more than one place. To avoid
		repeating the list of proc-funcs called by it,an asterisk
		is printed after the name to indicate that it has already
		been 'described'. Instead of the line numbers for its
		appearance in the program, that for its appearance in this
		part of the listing is given, so that you can refer to it.
		9.4. UTILITY PROGRAMS: PFORM.		-64-
 
 
	9.3. Utility Programs: PFORM
	----------------------------
		
	  PFORM is a pretty-printing program for PASCAL source files,
	useful to reformat programs (indentation, upper-lower case)
	and to find omitted or excessive BEGINS and ENDS.

	  INPUT: through the file OLDSOURCE, a PASCAL source program file.

	  OUTPUT: through the file NEWSOURCE:
		a copy of your input file, prettyprinted.
		(proper indentation according to the statement nesting,
		 newline on standard places in the program, management
		 of upper and lower case according to the list of reserved
		 words, etc.)

	  By default, PFORM will change all reserved words and strings to upper
	case, comments and everything else to lower case. There are switches 
	available to change this condition.

	  TO USE IT: You type:

		@PFORM

	Example:

		@pform
		OLDSOURCE= myprog.pas/comm:u
		NEWSOURCE=   <CR>

	  The switches should be spelled correctly. This one asks for comments to
	appear in lower case. The default for NEWSOURCE is myprog.new.

	  The default casing is as follows:
	
		Reserved words:		Upper case.
		Strings:		Upper case.
		Comments:		Lower case.
		Other words:		Lower case.
	
	  You can change the case by using the appropriate switches. Since 
	PASCAL programs see all input in upper case, there is no way to
	let the output look exactly like the input.
	
		9.4.1. SWITCHES.			-65-
 
 
	9.4.1. Switches
	---------------
	
					Brackets indicate optional.
   					<n> stands for an integer number.
   					<L> stands for a letter.

	   Switch	   Meaning					Default.

	--------PAGE AND LINE FORMAT-----------------------------------------

	/INDENT:<n>     indentation between levels.                    4
     
	--------STATEMENT FORMAT---------------------------------------------

	/BEGIN:[-]<n>   if the [-] is not there, the contents of a
	
	                  begin..end block is indented n spaces further.
	                if it is there, the block will not be indented,
	                  but the begin and end statements will be
	                  exdented n spaces.                           0
	/[NO]FORCE      forces newline in standard places. (before and
	                 after begin, end, then, else, repeat, etc.)   off
     
	--------UPPER AND LOWER CASE-----------------------------------------
	                       note: the possible values for <l> are:
	                               u means upper case
	                               l means lower case.
     
	/RES:<l>        case used for reserved words.                  u
	/NONRES:<l>     same for non-reserved words.                   l
	/COMM:<l>       same for comments.                             l
	/STR:<l>        same for strings.                              u
	/CASE:<l>       resets all the defaults to <l>.                        off
		10. REFERENCES.				-66-
 
 
	10. References
	==============
	
	[1] N. Wirth
	    The Programming Language PASCAL
	    Acta Informatica 1, 35 (1971)
	    and
	    Revised Report
	    Bericht Nr. 5
	    Berichte der Fachgruppe Computer-Wissenschaften
	    ETH Zurich, July 1973
	
	[2] K. Jensen, N. Wirth
	    PASCAL - User Manual and Report
	    Lecture Notes in Computer Science, vol 18
	    Springer Verlag, Berlin, Heidelberg, New York, 1974
	
	[3] C.A.R. Hoare and N. Wirth
	    An Axiomatic Definition of the Programming Language PASCAL,
	    Bericht Nr. 6
	    Berichte der Fachgruppe Computer-Wissenschaften
	    ETH Zurich, November 1972
	
	[4] K.V. Nori, U. Ammann, K. Jensen, H.H. Naegeli
	    The PASCAL-P Compiler: Implementation Notes
	    Bericht Nr. 10
	    Berichte der Fachgruppe Computer-Wissenschaften
	    ETH Zurich, December 1974
	
	[5] C. O. Grosse-Lindemann, H. H. Nagel
	    Postlude to a PASCAL-Compiler bootstrap on a DEC System-10
	    Bericht Nr. 11
	    Institut fuer Informatik der Universitaet Hamburg, October 1974
	    and
	    Software - Practice and Experience 6, 29-42 (1976)
	
	[6] G. Friesland, C. O. Grosse-Lindemann, F.H. Lorenz
	    H. H. Nagel, P. J. Stirl
	    A PASCAL Compiler Bootstrapped on a DECSystem-10
	    in 3. GI-Fachtagung ueber Programmiersprachen
	    Lecture Notes in Computer Science, Vol 7, page 101
	    Springer Verlag Berlin, Heidelberg, New York, 1974
	
	[7] H. H. Nagel
	    PASCAL for the DECSystem-10, Experiences and Further Plans
	    Mitteilung Nr. 21
	    Institut fuer Informatik der Universitaet Hamburg, November 1975
	
	[8] DECSystem-10 Operating System Commands
	    Digital Equipment Corporation, Maynard/ Massachussetts,1971(1974)
	
	[9] DECSystem-10 FORTRAN-10 Language Manual
	    Digital Equipment Corporation, Maynard/ Massachussetts,1967(1974)
_	_	10. REFERENCES.				-67-
 
	
	[10]P.Putfarken
	    Testhilfen fuer PASCAL-Programme
	    Diplomarbeit
	    Institut fuer Informatik der Universitaet Hamburg
	    November 1976
 
	[11]W.F. Burger, H. H. Nagel
	    PASCAL on the DEC10
	    Technical Report No. 22B
	    The University of Texas at Austin
	    Austin, Texas 78712
 
	[12]B.Nebel, B.Pretschner
	    Erweiterung des DECSystem-10 PASCAL-Compilers um eine
	    Moeglichkeit zur Erzeugung eines Post-Mortem-Dump
	    Mitteilung Nr. 34
	    Institut fuer Informatik der Universitaet Hamburg, Juni 1976